Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve the CHANGELOG entry [ci skip]

  • Loading branch information...
commit df2104e06784a4b98d8f30cb3ea4eee69304e768 1 parent 27411a7
Rafael Mendonça França rafaelfranca authored
Showing with 19 additions and 2 deletions.
  1. +19 −2 activerecord/CHANGELOG.md
21 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*
Please sign in to comment.
Something went wrong with that request. Please try again.