diff options
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 |