diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2012-01-29 22:49:45 -0800 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2012-01-29 22:49:45 -0800 |
commit | 30327a00a0a809ca1c8d7dc0fe3261159346f066 (patch) | |
tree | fa299c7a3b3dc67bbe452a8d09ae4f9155498172 /railties | |
parent | dfa0c36204beb1b519962a6a49a1ebbed91015dd (diff) | |
parent | 44bd9719e938dd8e8e6764f00d2c6ba40b4d34e3 (diff) | |
download | rails-30327a00a0a809ca1c8d7dc0fe3261159346f066.tar.gz rails-30327a00a0a809ca1c8d7dc0fe3261159346f066.tar.bz2 rails-30327a00a0a809ca1c8d7dc0fe3261159346f066.zip |
Merge pull request #4745 from lest/patch-1
remove ruby 1.8 support code
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/base.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb index a98244c525..8f779316c1 100644 --- a/railties/lib/rails/generators/base.rb +++ b/railties/lib/rails/generators/base.rb @@ -254,17 +254,13 @@ module Rails nesting = class_name.split('::') last_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) do |last_module, nest| - break unless last_module.const_defined?(nest, *extra) + break unless last_module.const_defined?(nest, false) last_module.const_get(nest) end - if last && last.const_defined?(last_name.camelize, *extra) + if last && last.const_defined?(last_name.camelize, false) raise Error, "The name '#{class_name}' is either already used in your application " << "or reserved by Ruby on Rails. Please choose an alternative and run " << "this generator again." |