From 3f049b0b6b5a338786c3dfafb31edf937f4ecb13 Mon Sep 17 00:00:00 2001 From: Marcel Molina Date: Thu, 30 Mar 2006 22:27:32 +0000 Subject: Do not implicitly mark recordss of has_many :through as readonly but do mark habtm records as readonly (eventually only on join tables without rich attributes). git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../active_record/associations/has_and_belongs_to_many_association.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations') diff --git a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb index 9bc29b049f..3f6fdb6bac 100644 --- a/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb +++ b/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb @@ -41,7 +41,7 @@ module ActiveRecord options[:conditions] = conditions options[:joins] = @join_sql - options[:readonly] ||= false + options[:readonly] ||= !options[:joins].nil? if options[:order] && @reflection.options[:order] options[:order] = "#{options[:order]}, #{@reflection.options[:order]}" -- cgit v1.2.3