Use cattr_accessors for Engines::Plugin defaults?


#1

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 removed_email_address@domain.invalid
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)