aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/commands.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-10 00:33:32 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-10 00:33:32 +0000
commit1ab84247ca4b80afbd82afe7539b3449636344c4 (patch)
tree9ca5e3bee3a07b68c9d900ff129b69bc740405c2 /railties/lib/rails_generator/commands.rb
parentb6fb79c531a0079274f7b459302e6290c9183f28 (diff)
parent4458edc882b229ea44602da20a6440a6f233f1c8 (diff)
downloadrails-1ab84247ca4b80afbd82afe7539b3449636344c4.tar.gz
rails-1ab84247ca4b80afbd82afe7539b3449636344c4.tar.bz2
rails-1ab84247ca4b80afbd82afe7539b3449636344c4.zip
Merge commit 'mainstream/master'
Conflicts: railties/guides/files/stylesheets/main.css railties/guides/rails_guides/generator.rb railties/guides/source/index.erb.textile
Diffstat (limited to 'railties/lib/rails_generator/commands.rb')
-rw-r--r--railties/lib/rails_generator/commands.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index 299044c3d7..b684dc92be 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -182,15 +182,19 @@ HELP
nesting = class_name.split('::')
name = nesting.pop
+ # Hack to limit const_defined? to non-inherited on 1.9.
+ extra = []
+ extra << false unless Object.method(:const_defined?).arity == 1
+
# Extract the last Module in the nesting.
last = nesting.inject(Object) { |last, nest|
- break unless last.const_defined?(nest)
+ break unless last.const_defined?(nest, *extra)
last.const_get(nest)
}
# If the last Module exists, check whether the given
# class exists and raise a collision if so.
- if last and last.const_defined?(name.camelize)
+ if last and last.const_defined?(name.camelize, *extra)
raise_class_collision(class_name)
end
end