diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-16 10:29:45 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-16 10:45:59 +0100 |
commit | 192e55c38ed9b48672b9e216c9805b782b835d78 (patch) | |
tree | 605ac731ca968efefcea18eec1b350574a170075 /activerecord/lib/active_record/relation | |
parent | 5359262695b491422b18c565567e16ad50f6155e (diff) | |
download | rails-192e55c38ed9b48672b9e216c9805b782b835d78.tar.gz rails-192e55c38ed9b48672b9e216c9805b782b835d78.tar.bz2 rails-192e55c38ed9b48672b9e216c9805b782b835d78.zip |
Do not raise an exception if an invalid route was generated automatically.
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/delegation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/delegation.rb b/activerecord/lib/active_record/relation/delegation.rb index 47fcc08550..f5fdf437bf 100644 --- a/activerecord/lib/active_record/relation/delegation.rb +++ b/activerecord/lib/active_record/relation/delegation.rb @@ -8,7 +8,7 @@ module ActiveRecord :connection, :columns_hash, :auto_explain_threshold_in_seconds, :to => :klass def self.delegate_to_scoped_klass(method) - if method.to_s =~ /[a-z]\w*!?/ + if method.to_s =~ /\A[a-zA-Z_]\w*[!?]?\z/ module_eval <<-RUBY, __FILE__, __LINE__ + 1 def #{method}(*args, &block) scoping { @klass.#{method}(*args, &block) } |