Permalink
Browse files

Improve the CHANGELOG entry [ci skip]

  • Loading branch information...
1 parent 27411a7 commit df2104e06784a4b98d8f30cb3ea4eee69304e768 @rafaelfranca rafaelfranca committed Jun 19, 2012
Showing with 19 additions and 2 deletions.
  1. +19 −2 activerecord/CHANGELOG.md
View
@@ -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*

0 comments on commit df2104e

Please sign in to comment.