Created
July 25, 2013 17:54
-
-
Save DanielWright/6082147 to your computer and use it in GitHub Desktop.
Rails4/ActiveAdmin/Heroku precompilation workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
# ... | |
module MyApp | |
class Application < Rails::Application | |
# ... | |
config.before_initialize do | |
Dir.glob(Rails.root.join('lib/**/*.rb')) do |c| | |
Rails.configuration.cache_classes ? require(c) : load(c) | |
end | |
end | |
# ... | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/extensions/active_admin/resource.rb | |
module Extensions | |
module ActiveAdmin | |
module Resource | |
extend ActiveSupport::Concern | |
included do | |
def default_options | |
{ sort_order: 'id_desc' } | |
end | |
end | |
end | |
end | |
end | |
::ActiveAdmin::Resource.send(:include, Extensions::ActiveAdmin::Resource) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment