From 192e55c38ed9b48672b9e216c9805b782b835d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 16 Dec 2011 10:29:45 +0100 Subject: Do not raise an exception if an invalid route was generated automatically. --- activerecord/lib/active_record/relation/delegation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation/delegation.rb') 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) } -- cgit v1.2.3