Skip to content
Browse files

minor speedup

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 8a7d73c commit f9ba8566b5b2e122c7af3b4445b0b990107567de @jeremy jeremy committed Sep 13, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/base.rb
View
4 activerecord/lib/active_record/base.rb
@@ -1631,8 +1631,8 @@ def set_readonly_option!(options) #: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

0 comments on commit f9ba856

Please sign in to comment.
Something went wrong with that request. Please try again.