aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-09-13 08:20:08 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-09-13 08:20:08 +0000
commitf9ba8566b5b2e122c7af3b4445b0b990107567de (patch)
treeac420694bbc228bdc02c3e397bc433393e5991e3
parent8a7d73cf4d3a92fd0546949f32c78fefffcb8bab (diff)
downloadrails-f9ba8566b5b2e122c7af3b4445b0b990107567de.tar.gz
rails-f9ba8566b5b2e122c7af3b4445b0b990107567de.tar.bz2
rails-f9ba8566b5b2e122c7af3b4445b0b990107567de.zip
minor speedup
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files 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