export_to_spreadsheet 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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