Mercurial > hg > soundsoftware-site
annotate .svn/pristine/b6/b6683def4ff299aa9cca77fe57bb77ce73743047.svn-base @ 1524:82fac3dcf466 redmine-2.5-integration
Fix failure to interpret Javascript when autocompleting members for project
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Thu, 11 Sep 2014 10:24:38 +0100 |
parents | cbb26bc654de |
children |
rev | line source |
---|---|
Chris@909 | 1 module PrependEngineViews |
Chris@909 | 2 def self.included(base) |
Chris@909 | 3 base.send(:include, InstanceMethods) |
Chris@909 | 4 base.class_eval do |
Chris@909 | 5 alias_method_chain :add_engine_view_paths, :prepend |
Chris@909 | 6 end |
Chris@909 | 7 end |
Chris@909 | 8 |
Chris@909 | 9 module InstanceMethods |
Chris@909 | 10 # Patch Rails so engine's views are prepended to the view_path, |
Chris@909 | 11 # thereby letting plugins override application views |
Chris@909 | 12 def add_engine_view_paths_with_prepend |
Chris@909 | 13 paths = ActionView::PathSet.new(engines.collect(&:view_path)) |
Chris@909 | 14 ActionController::Base.view_paths.unshift(*paths) |
Chris@909 | 15 ActionMailer::Base.view_paths.unshift(*paths) if configuration.frameworks.include?(:action_mailer) |
Chris@909 | 16 end |
Chris@909 | 17 end |
Chris@909 | 18 end |
Chris@909 | 19 |
Chris@909 | 20 Rails::Plugin::Loader.send :include, PrependEngineViews |
Chris@909 | 21 |