diff options
-rw-r--r-- | activerecord/CHANGELOG.md | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index a617cef6a1..cc18981e93 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,8 +1,25 @@ ## Rails 4.0.0 (unreleased) ## -* `composed_of` has removed. You'll have to write your own accessor +* `composed_of` was removed. You'll have to write your own accessor and mutator methods if you'd like to use value objects to represent some - portion of your models. + portion of your models. So, instead of: + + class Person < ActiveRecord::Base + composed_of :address, :mapping => [ %w(address_street street), %w(address_city city) ] + end + + you could write something like this: + + def address + @address ||= Address.new(address_street, address_city) + end + + def address=(address) + self[:address_street] = @address.street + self[:address_city] = @address.city + + @address = address + end *Steve Klabnik* |