diff options
author | Sam Pohlenz <sam@sampohlenz.com> | 2009-12-27 11:16:34 +1030 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-12-29 14:45:43 -0800 |
commit | cbce027669ded4e951af3124cae23d6707357aea (patch) | |
tree | c65a7602001b6ba5b880e51e43003e374ecf2696 /railties/lib/rails/plugin.rb | |
parent | 2e87196d14f0cb7b75a6b81cbd8a0810ed684de9 (diff) | |
download | rails-cbce027669ded4e951af3124cae23d6707357aea.tar.gz rails-cbce027669ded4e951af3124cae23d6707357aea.tar.bz2 rails-cbce027669ded4e951af3124cae23d6707357aea.zip |
Application object should instantiate non-vendored plugins
Signed-off-by: Carl Lerche <carllerche@mac.com>
Diffstat (limited to 'railties/lib/rails/plugin.rb')
-rw-r--r-- | railties/lib/rails/plugin.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index be6cdec3fa..b5e6953fef 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -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. |