diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-05 21:53:53 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-12-05 21:53:53 +0000 |
commit | 2e47db2fbd7ea381e3680ffa8ee0ae8547078970 (patch) | |
tree | 4dfd32ddf79fb56ab61818bfa9aeef657db22506 /activerecord/lib | |
parent | c924279403ff5bdb591405109ccc4590373d3057 (diff) | |
download | rails-2e47db2fbd7ea381e3680ffa8ee0ae8547078970.tar.gz rails-2e47db2fbd7ea381e3680ffa8ee0ae8547078970.tar.bz2 rails-2e47db2fbd7ea381e3680ffa8ee0ae8547078970.zip |
Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8313 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 3d10721af6..b26ea586e5 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 @@ -47,7 +47,7 @@ module ActiveRecord options[:conditions] = conditions options[:joins] = @join_sql - options[:readonly] = finding_with_ambiguous_select?(options[:select]) + options[:readonly] = finding_with_ambiguous_select?(options[:select] || @reflection.options[:select]) if options[:order] && @reflection.options[:order] options[:order] = "#{options[:order]}, #{@reflection.options[:order]}" @@ -57,7 +57,7 @@ module ActiveRecord merge_options_from_reflection!(options) - options[:select] ||= '*' + options[:select] ||= (@reflection.options[:select] || '*') # Pass through args exactly as we received them. args << options |