export_to_spreadsheet 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,8 +12,8 @@
12
12
  # end
13
13
  module ExportToSpreadsheet
14
14
  # If we have a file that tweaks the export plug-in from the point of view of the application, we require it
15
- if defined?(RAILS_ROOT)
16
- required_file = RAILS_ROOT + '/lib/before_prepare_export.rb'
15
+ if defined?(Rails)
16
+ required_file = "#{Rails.root}/lib/before_prepare_export.rb"
17
17
  require required_file if File.exists?(required_file)
18
18
  end
19
19
 
@@ -8,8 +8,7 @@ module SalesClicExporter::Document
8
8
  # SalesClicExporter::Document.allowed_extensions #=> ['xls', 'google_spreadsheet']
9
9
  def self.allowed_extensions
10
10
  subclasses = self::Base.subclasses
11
- subclasses.map do |str_klass|
12
- klass = str_klass.constantize
11
+ subclasses.map do |klass|
13
12
  klass.const_defined?(:Extension) ? klass::Extension : nil
14
13
  end.compact
15
14
  end