Skip to content

Commit

Permalink
Moved the loadpath reversal from config/initializers back into applic…
Browse files Browse the repository at this point in the history
…ation.rb, since they need to load earlier
  • Loading branch information
ndbroadbent committed Dec 8, 2011
1 parent b56f6da commit 6152f5b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 18 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@
# Bundler.require(:default, :assets, Rails.env)
end

# Override engine views so that plugin views have higher priority.
Rails::Engine.initializers.detect{|i| i.name == :add_view_paths }.
instance_variable_set("@block", Proc.new {
views = paths.app.views.to_a
unless views.empty?
ActiveSupport.on_load(:action_controller){ append_view_path(views) }
ActiveSupport.on_load(:action_mailer){ append_view_path(views) }
end
}
)

# Override I18n load paths so that plugin locales have higher priority.
Rails::Engine.initializers.detect{|i| i.name == :add_locales }.
instance_variable_set("@block", Proc.new {
config.i18n.railties_load_path.concat( paths.config.locales.to_a ).reverse!
}
)

module FatFreeCRM
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
Expand Down
18 changes: 0 additions & 18 deletions config/initializers/reverse_load_paths.rb

This file was deleted.

0 comments on commit 6152f5b

Please sign in to comment.