From 823554eafef9e8ee8fe2788f6231a3e665c2cbbf Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Jan 2005 17:45:16 +0000 Subject: Added support for associating unsaved objects #402 [Tim Bates] Added replace to associations, so you can do project.manager.replace(new_manager) or project.milestones.replace(new_milestones) #402 [Tim Bates] Added build and create methods to has_one and belongs_to associations, so you can now do project.manager.build(attributes) #402 [Tim Bates] Fixed that Base#== wouldn't work for multiple references to the same unsaved object #402 [Tim Bates] Added that if a before_* callback returns false, all the later callbacks and the associated action are cancelled. If an after_* callback returns false, all the later callbacks are cancelled. Callbacks are generally run in the order they are defined, with the exception of callbacks defined as methods on the model, which are called last. #402 [Tim Bates] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@417 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/fixtures/company.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/fixtures') diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb index 7d9a6053d4..579590e909 100755 --- a/activerecord/test/fixtures/company.rb +++ b/activerecord/test/fixtures/company.rb @@ -1,5 +1,7 @@ class Company < ActiveRecord::Base attr_protected :rating + + validates_presence_of :name end -- cgit v1.2.3