Forum: Rails Engines development Use cattr_accessors for Engines::Plugin defaults?

402602a60e500e85f2f5dc1ff3648ecb?d=identicon&s=25 Sven Fuchs (Guest)
on 2008-04-14 22:42
(Received via mailing list)
In Engines::Plugin we have:

module Engines
   class Plugin < Rails::Plugin
       # ...
       def default_code_paths
         %w(app/controllers app/helpers app/models components lib)
       end

which is great because now one can overwrite this in environment.rb
(after Engines has "booted"):

Engines::Plugin.class_eval do
   def default_code_paths
     %w(app/controllers app/helpers app/models app/observers
components lib)
   end
end

Wouldn't it make even more sense to just use cattr_accessors for these
defaults?

Along the lines of:

module Engines
   class Plugin < Rails::Plugin
       @@default_code_paths = %w(app/controllers app/helpers app/
models components lib)
       cattr_accessor :default_code_paths

Redefining the default_code_paths would then be a little less clumpsy:

Engines::Plugin.default_code_paths = %w(app/controllers app/helpers
app/models app/observers components lib)

Hu?

--
sven fuchs      svenfuchs@artweb-design.de
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)
This topic is locked and can not be replied to.