diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-03-07 11:45:07 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-03-07 11:45:07 +0000 |
commit | e1173500379ab35734ac9101e58d6eff6552ef6e (patch) | |
tree | 215fc1abeb3e005f6dbc01f4d639c18f43883f16 /activerecord/lib | |
parent | 8a351648ab613d42bbbf44586cff8cdeccd181d4 (diff) | |
download | rails-e1173500379ab35734ac9101e58d6eff6552ef6e.tar.gz rails-e1173500379ab35734ac9101e58d6eff6552ef6e.tar.bz2 rails-e1173500379ab35734ac9101e58d6eff6552ef6e.zip |
Add :readonly option to HasManyThrough associations. Closes #11156 [miloops]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8989 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 72bf693384..8c10ac641b 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -159,6 +159,7 @@ module ActiveRecord :order => @reflection.options[:order], :limit => @reflection.options[:limit], :group => @reflection.options[:group], + :readonly => @reflection.options[:readonly], :include => @reflection.options[:include] || @reflection.source_reflection.options[:include] ) @@ -253,7 +254,9 @@ module ActiveRecord :include => @reflection.options[:include], :select => construct_select, :order => @reflection.options[:order], - :limit => @reflection.options[:limit] } } + :limit => @reflection.options[:limit], + :readonly => @reflection.options[:readonly], + } } end def construct_sql |