diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 13:40:21 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-03-06 13:40:21 +0000 |
commit | 7267db58906434da54e0f50122b5e8b704b1c953 (patch) | |
tree | 089ebe97424e2fab2630f629c7a5af1a21d72057 /activerecord/CHANGELOG | |
parent | 838ae35d63c34872d46bee8b006796ebdd9c7722 (diff) | |
download | rails-7267db58906434da54e0f50122b5e8b704b1c953.tar.gz rails-7267db58906434da54e0f50122b5e8b704b1c953.tar.bz2 rails-7267db58906434da54e0f50122b5e8b704b1c953.zip |
Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@843 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/CHANGELOG')
-rw-r--r-- | activerecord/CHANGELOG | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index d17ff99f54..63daed1433 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,19 @@ *SVN* +* Added destruction of dependent objects in has_one associations when a new assignment happens #742 [mindel]. Example: + + class Account < ActiveRecord::Base + has_one :credit_card, :dependent => true + end + class CreditCard < ActiveRecord::Base + belongs_to :account + end + + account.credit_card # => returns existing credit card, lets say id = 12 + account.credit_card = CreditCard.create("number" => "123") + account.save # => CC with id = 12 is destroyed + + * Added validates_numericality_of #716 [skanthak/c.r.mcgrath]. Docuemntation: Validates whether the value of the specified attribute is numeric by trying to convert it to |