aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-12-16 10:29:45 +0100
committerJosé Valim <jose.valim@gmail.com>2011-12-16 10:45:59 +0100
commit192e55c38ed9b48672b9e216c9805b782b835d78 (patch)
tree605ac731ca968efefcea18eec1b350574a170075 /activerecord/lib/active_record/relation
parent5359262695b491422b18c565567e16ad50f6155e (diff)
downloadrails-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.rb2
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) }