1. 19 6月, 2012 2 次提交
    • S
      Removing composed_of from ActiveRecord. · 14fc8b34
      Steve Klabnik 提交于
      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.
      
      Closes #1436
      Closes #2084
      Closes #3807
      14fc8b34
    • K
      052e415f
  2. 18 6月, 2012 7 次提交
  3. 17 6月, 2012 8 次提交
  4. 16 6月, 2012 6 次提交
  5. 15 6月, 2012 4 次提交
  6. 14 6月, 2012 2 次提交
  7. 13 6月, 2012 1 次提交
  8. 12 6月, 2012 5 次提交
  9. 11 6月, 2012 5 次提交