1. 29 11月, 2014 1 次提交
  2. 28 7月, 2012 1 次提交
  3. 19 6月, 2012 1 次提交
    • 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
  4. 22 5月, 2012 1 次提交
  5. 03 5月, 2012 1 次提交
    • Y
      allow the :converter Proc form composed_of to return nil · fa5f0375
      Yves Senn 提交于
      This makes it possible to filter invalid input values before they are passed
      into the value-object (like empty strings). This behaviour is only relevant
      if the :allow_nil options is set to true. Otherwise you will get
      the resulting NoMethodError.
      fa5f0375
  6. 08 1月, 2011 1 次提交
  7. 11 9月, 2008 1 次提交
  8. 18 1月, 2008 1 次提交
  9. 24 10月, 2007 1 次提交
  10. 22 5月, 2006 1 次提交
  11. 07 4月, 2006 1 次提交
  12. 08 12月, 2005 1 次提交
  13. 02 3月, 2005 1 次提交
  14. 24 11月, 2004 1 次提交