aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2006-08-05 22:35:58 +0000
committerMichael Koziarski <michael@koziarski.com>2006-08-05 22:35:58 +0000
commit6ba4f4c524f73db062016701c9f93c70b08d93c0 (patch)
tree3aed4ba05b8a673ee7bb08605cd2f93eee12b9cc
parent196fab9b0dcbdc83e27241678ebb2557ca4e030e (diff)
downloadrails-6ba4f4c524f73db062016701c9f93c70b08d93c0.tar.gz
rails-6ba4f4c524f73db062016701c9f93c70b08d93c0.tar.bz2
rails-6ba4f4c524f73db062016701c9f93c70b08d93c0.zip
Formally deprecate rich associations. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4680 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG
index 614cb2a1c0..6cc7c245d5 100644
--- a/activerecord/CHANGELOG
+++ b/activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Formally deprecate rich associations. [Koz]
+
* Fixed that default timezones for new / initialize should uphold utc setting #5709 [daniluk@yahoo.com]
* Fix announcement of very long migration names. #5722 [blake@near-time.com]
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 42cf549dcb..fc1de92259 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
@@ -67,7 +67,9 @@ module ActiveRecord
@reflection.klass.find(*args)
end
end
-
+
+ # Deprecated as of Rails 1.2. If your associations require attributes
+ # you should be using has_many :through
def push_with_attributes(record, join_attributes = {})
raise_on_type_mismatch(record)
join_attributes.each { |key, value| record[key.to_s] = value }
@@ -79,6 +81,7 @@ module ActiveRecord
self
end
+ deprecate :push_with_attributes
alias :concat_with_attributes :push_with_attributes