aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorStefan Sprenger <stefan.sprenger@dkd.de>2011-06-07 11:36:11 +0200
committerStefan Sprenger <stefan.sprenger@dkd.de>2011-06-07 11:36:11 +0200
commit8ea90ffdb8a08438e72054518f8f0b54c628b3ea (patch)
treebf545325e2d5b132444f7b02974423c8511d2a52 /railties
parent64f337eeb0072616520c8ec7f40e2fdd5b90f26e (diff)
downloadrails-8ea90ffdb8a08438e72054518f8f0b54c628b3ea.tar.gz
rails-8ea90ffdb8a08438e72054518f8f0b54c628b3ea.tar.bz2
rails-8ea90ffdb8a08438e72054518f8f0b54c628b3ea.zip
Use mattr_accessor :namespace
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/generators.rb12
-rw-r--r--railties/test/railties/generators_test.rb3
2 files changed, 2 insertions, 13 deletions
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.
diff --git a/railties/test/railties/generators_test.rb b/railties/test/railties/generators_test.rb
index 4f96e4d9ef..963518880d 100644
--- a/railties/test/railties/generators_test.rb
+++ b/railties/test/railties/generators_test.rb
@@ -58,9 +58,6 @@ module RailtiesTests
build_engine(true)
end
- def setup
- end
-
def test_controllers_are_correctly_namespaced_when_engine_is_mountable
build_mountable_engine
Dir.chdir(engine_path) do