Mercurial > hg > soundsoftware-site
comparison .svn/pristine/b6/b6683def4ff299aa9cca77fe57bb77ce73743047.svn-base @ 909:cbb26bc654de redmine-1.3
Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author | Chris Cannam |
---|---|
date | Fri, 24 Feb 2012 19:09:32 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
908:c6c2cbd0afee | 909:cbb26bc654de |
---|---|
1 module PrependEngineViews | |
2 def self.included(base) | |
3 base.send(:include, InstanceMethods) | |
4 base.class_eval do | |
5 alias_method_chain :add_engine_view_paths, :prepend | |
6 end | |
7 end | |
8 | |
9 module InstanceMethods | |
10 # Patch Rails so engine's views are prepended to the view_path, | |
11 # thereby letting plugins override application views | |
12 def add_engine_view_paths_with_prepend | |
13 paths = ActionView::PathSet.new(engines.collect(&:view_path)) | |
14 ActionController::Base.view_paths.unshift(*paths) | |
15 ActionMailer::Base.view_paths.unshift(*paths) if configuration.frameworks.include?(:action_mailer) | |
16 end | |
17 end | |
18 end | |
19 | |
20 Rails::Plugin::Loader.send :include, PrependEngineViews | |
21 |