aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG30
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb4
2 files changed, 4 insertions, 30 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 6ebb9eeea9..b93f6e63d4 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH]
+
* Document how the :include option can be used in Calculations::calculate. Closes #7446 [adamwiggins, ultimoamore]
* Fix typo in documentation for polymorphic associations w/STI. Closes #7461 [johnjosephbachir]
@@ -8,34 +10,6 @@
* More complete documentation for find_by_sql. Closes #7912 [fearoffish]
-* Document API for exists?'s parameter and provide examples of usage. Closes #7913 [fearoffish]
-
-* Document API for create's attributes parameter and provide examples. Closes #7915 [fearoffish]
-
-* Documentation for find incorrectly omits the :conditions option from various examples. Closes #7923 [mattwestcott]
-
-* Document options and add examples for update. Closes #7985 [fearoffish]
-
-* Document options and add examples for delete. Closes #7986 [fearoffish]
-
-* Document options and add examples for destroy. Closes #7988 [fearoffish]
-
-* Document options and add examples for update_all. Closes #7990 [fearoffish]
-
-* Document options for update_counters. Closes #8091 [fearoffish]
-
-* Add documentation about the virtual attribute added by validates_confirmation_of and its behavior. Closes #8815 [JEG2, matt, kampers]
-
-* Add documentation for freeze and readonly related methods. Closes #8878 [pelargir, jeremymcanally]
-
-* Document the timestamps schema definition method. Closes #9000 [mikong]
-
-* Give examples for what tables should be called for models inside a module namespace. Closes #10288 [scott_willson]
-
-* Document the :message option for validates_associated. Closes #10357 [dylans]
-
-* Document automatically generated predicate methods for attributes. Closes #10373 [chuyeow]
-
* Added ActiveRecord::Base#becomes to turn a record into one of another class (mostly relevant for STIs) [DHH]. Example:
render :partial => @client.becomes(Company) # renders companies/company instead of clients/client
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