Application object should instantiate non-vendored plugins
Signed-off-by: Carl Lerche <carllerche@mac.com>
This commit is contained in:
parent
2e87196d14
commit
cbce027669
|
@ -98,7 +98,7 @@ module Rails
|
|||
def plugins
|
||||
@plugins ||= begin
|
||||
plugin_names = config.plugins || [:all]
|
||||
Plugin.plugins.select { |p| plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) } +
|
||||
Plugin.plugins.select { |p| plugin_names.include?(:all) || plugin_names.include?(p.plugin_name) }.map { |p| p.new } +
|
||||
Plugin::Vendored.all(config.plugins || [:all], config.paths.vendor.plugins)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,12 +27,17 @@ module Rails
|
|||
|
||||
def self.rake_tasks(&blk)
|
||||
@rake_tasks ||= []
|
||||
@rake_tasks << blk
|
||||
@rake_tasks << blk if blk
|
||||
@rake_tasks
|
||||
end
|
||||
|
||||
def self.load_tasks
|
||||
return unless @rake_tasks
|
||||
@rake_tasks.each { |blk| blk.call }
|
||||
def rake_tasks
|
||||
self.class.rake_tasks
|
||||
end
|
||||
|
||||
def load_tasks
|
||||
return unless rake_tasks
|
||||
rake_tasks.each { |blk| blk.call }
|
||||
end
|
||||
|
||||
# Creates an initializer which includes all given modules to the given class.
|
||||
|
|
Loading…
Reference in New Issue