Skip to content

Commit

Permalink
Override engine logic so that plugin views and locales have higher pr…
Browse files Browse the repository at this point in the history
…iority.
  • Loading branch information
ndbroadbent committed Nov 26, 2011
1 parent f9ba623 commit 0734675
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
# 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

0 comments on commit 0734675

Please sign in to comment.