aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-03-13 09:45:09 +0000
committerMichael Koziarski <michael@koziarski.com>2007-03-13 09:45:09 +0000
commit5bd116ccf4e341b25dbba418b6c5f0ed3b0c5187 (patch)
tree580463b18d98f9992194601d59975a5687bb31a5 /activerecord/lib
parentf770165cc23a44ac329b5b1fbd47376a6c2e3f11 (diff)
downloadrails-5bd116ccf4e341b25dbba418b6c5f0ed3b0c5187.tar.gz
rails-5bd116ccf4e341b25dbba418b6c5f0ed3b0c5187.tar.bz2
rails-5bd116ccf4e341b25dbba418b6c5f0ed3b0c5187.zip
Make sure with_scope takes both :select and :joins into account when setting :readonly. Allows you to save records you retrieve using finders on a has_many :through associations. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index f3d4cf856a..03c0054bd0 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -938,7 +938,7 @@ module ActiveRecord #:nodoc:
if f = method_scoping[:find]
f.assert_valid_keys([ :conditions, :joins, :select, :include, :from, :offset, :limit, :order, :readonly, :lock ])
- f[:readonly] = true if !f[:joins].blank? && !f.has_key?(:readonly)
+ set_readonly_option! f
end
# Merge scopings