-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
executable file
·26 lines (22 loc) · 1.03 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Make sure that ActiveScaffold has already been included
ActiveScaffold rescue throw "should have included ActiveScaffold plug in first. Please make sure that this plug-in comes alphabetically after the ActiveScaffold plug-in"
# Load our overrides
Kernel::load File.dirname(__FILE__) + '/lib/actions/export.rb'
Kernel::load File.dirname(__FILE__) + '/lib/config/template_finder.rb'
Kernel::load File.dirname(__FILE__) + '/lib/config/export.rb'
Kernel::load File.dirname(__FILE__) + '/lib/config/core.rb'
Kernel::load File.dirname(__FILE__) + '/lib/helpers/view_helpers_override.rb'
Kernel::load File.dirname(__FILE__) + '/lib/helpers/export_helpers.rb'
##
## Run the install script, too, just to make sure
## But at least rescue the action in production
##
begin
require File.dirname(__FILE__) + '/install'
rescue
raise $! unless RAILS_ENV == 'production'
end
# Add the csv mime type
Mime::Type.register 'text/csv', :csv
# Register our helper methods
ActionView::Base.send(:include, ActiveScaffold::Helpers::ExportHelpers)