Engines’ magic code mixing is mega-cool, but unfortunately it doesn’t
apply to the application controller because of the non-standard file-
naming application.rb, which misses the “_controller” bit and doesn’t
match the regular expression in dependencies.rb.
Is there a reason not to allow this feature for the application
controller? I’d like to move quite some stuff from an application
controller that I’m splitting up into engines … and there’s just no
more comprehensible place to use than plugin_name/app/controllers/
application.rb.
So, can I apply the following?
I don’t think there’s any potential harm resulting from this.
Thanks!
Index: /engines/lib/engines/rails_extensions/dependencies.rb
— /engines/lib/engines/rails_extensions/dependencies.rb (revision
668)
+++ /engines/lib/engines/rails_extensions/dependencies.rb (working
copy)
@@ -102,7 +102,7 @@
# if we recognise this type
# (this regexp splits out the module/filename from any
instances of app/#{type}, so that
# modules are still respected.)
-
if file_name =~ /^(.*app\/#{file_type}s\/)?(.*_#{file_type})
(.rb)?$/
-
if file_name =~ /^(.*app\/#{file_type}s\/)?(.*_#{file_type}|
application)(.rb)?$/
base_name = $2
# … go through the plugins from first started to last, so
that
# code with a high precedence (started later) will override
lower precedence
–
sven fuchs [email protected]
artweb design http://www.artweb-design.de
grünberger 65 + 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin + 49 (0) 171 - 35 20 38 4 (mobile)