From 0e225ec583db523a8b7da332eaf689149ed60447 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Thu, 30 Jun 2011 22:41:18 +0100 Subject: Assign the association attributes to the associated record before the before_initialize callback of the record runs. Fixes #1842. --- activerecord/CHANGELOG | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord/CHANGELOG') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index ead2a244e5..4113a16c12 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,17 @@ *Rails 3.1.0 (unreleased)* +* ActiveRecord::MacroReflection::AssociationReflection#build_record has a new method signature. + + Before: def build_association(*options) + After: def build_association(*options, &block) + + Users who are redefining this method to extend functionality should ensure that the block is + passed through to ActiveRecord::Base#new. + + This change is necessary to fix https://github.com/rails/rails/issues/1842. + + [Jon Leighton] + * AR#pluralize_table_names can be used to singularize/pluralize table name of an individual model: class User < ActiveRecord::Base -- cgit v1.2.3