From 8ea90ffdb8a08438e72054518f8f0b54c628b3ea Mon Sep 17 00:00:00 2001 From: Stefan Sprenger Date: Tue, 7 Jun 2011 11:36:11 +0200 Subject: Use mattr_accessor :namespace --- railties/lib/rails/generators.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'railties/lib/rails/generators.rb') diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb index 508d5359ba..355b05ce0b 100644 --- a/railties/lib/rails/generators.rb +++ b/railties/lib/rails/generators.rb @@ -20,6 +20,8 @@ module Rails autoload :ResourceHelpers, 'rails/generators/resource_helpers' autoload :TestCase, 'rails/generators/test_case' + mattr_accessor :namespace + DEFAULT_ALIASES = { :rails => { :actions => '-a', @@ -90,16 +92,6 @@ module Rails @options ||= DEFAULT_OPTIONS.dup end - def self.namespace - @namespace ||= if defined?(Rails) && Rails.application - Rails.application.class.parents.detect { |n| n.respond_to?(:_railtie) } - end - end - - def self.namespace=(namespace) - @namespace ||= namespace - end - # Hold configured generators fallbacks. If a plugin developer wants a # generator group to fallback to another group in case of missing generators, # they can add a fallback. -- cgit v1.2.3