From f9ba8566b5b2e122c7af3b4445b0b990107567de Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 13 Sep 2007 08:20:08 +0000 Subject: minor speedup git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index b922b869bd..4dfd4a26b1 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1631,8 +1631,8 @@ module ActiveRecord #:nodoc: # Inherit :readonly from finder scope if set. Otherwise, # if :joins is not blank then :readonly defaults to true. unless options.has_key?(:readonly) - if scoped?(:find, :readonly) - options[:readonly] = scope(:find, :readonly) + if scoped_readonly = scope(:find, :readonly) + options[:readonly] = scoped_readonly elsif !options[:joins].blank? && !options[:select] options[:readonly] = true end -- cgit v1.2.3