Files
rails/activerecord/test/models
Steve Klabnik 44b313bc4e Deprecating composed_of in ActiveRecord
This feature adds a lot of complication to ActiveRecord for dubious
value. Let's talk about what it does currently:

class Customer < ActiveRecord::Base
  composed_of :balance, :class_name => "Money", :mapping => %w(balance
amount)
end

Instead, you can do something like this:

    def balance
      @balance ||= Money.new(value, currency)
    end

    def balance=(balance)
      self[:value] = balance.value
      self[:currency] = balance.currency
      @balance = balance
    end

Since that's fairly easy code to write, and doesn't need anything
extra from the framework, if you use composed_of today, you'll
have to add accessors/mutators like that.

This feature will be removed in Rails 4.
2012-06-18 15:38:51 -04:00
..
2011-10-13 15:54:53 -07:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2010-08-14 18:49:04 -03:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2010-07-25 23:30:27 +02:00
2008-01-18 07:27:03 +00:00
2011-05-31 19:47:34 +01:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2010-10-31 11:21:28 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-01-18 07:27:03 +00:00
2008-05-01 15:03:16 -05:00
2008-01-18 07:27:03 +00:00
2011-03-16 18:54:34 +00:00
2011-12-23 18:22:42 +00:00
2008-01-18 07:27:03 +00:00