From 3f1acf49bd4cfa902388f000ca96c848c3666017 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 15 Sep 2006 07:02:05 +0000 Subject: Deprecation tests. Remove warnings for dynamic finders and for the foo_count ethod if it's also an attribute. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index e9c9212560..43f631ef6c 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1198,7 +1198,7 @@ module ActiveRecord #:nodoc: when nil options = { :conditions => conditions } set_readonly_option!(options) - send(finder, options) + ActiveSupport::Deprecation.silence { send(finder, options) } when Hash finder_options = extra_options.merge(:conditions => conditions) @@ -1207,14 +1207,16 @@ module ActiveRecord #:nodoc: if extra_options[:conditions] with_scope(:find => { :conditions => extra_options[:conditions] }) do - send(finder, finder_options) + ActiveSupport::Deprecation.silence { send(finder, finder_options) } end else - send(finder, finder_options) + ActiveSupport::Deprecation.silence { send(finder, finder_options) } end else - send(deprecated_finder, conditions, *arguments[attribute_names.length..-1]) # deprecated API + ActiveSupport::Deprecation.silence do + send(deprecated_finder, conditions, *arguments[attribute_names.length..-1]) + end end elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\w*)/.match(method_id.to_s) instantiator = determine_instantiator(match) -- cgit v1.2.3