1. 27 5月, 2017 1 次提交
  2. 23 5月, 2017 1 次提交
  3. 22 5月, 2017 1 次提交
  4. 03 5月, 2017 2 次提交
  5. 30 4月, 2017 1 次提交
  6. 24 4月, 2017 2 次提交
  7. 15 4月, 2017 1 次提交
    • A
      Move around AR::Dirty and fix _attribute method · 83d6cc48
      Aaron Patterson 提交于
      We already have a _read_attribute method that can get the value we need
      from the model.  Lets define that method in AM::Dirty and use the
      existing one from AR::Dirty rather than introducing a new method.
      83d6cc48
  8. 13 4月, 2017 1 次提交
  9. 12 4月, 2017 2 次提交
  10. 02 4月, 2017 1 次提交
    • T
      No need to check nil · d1ca18d2
      Tsukuru Tanimichi 提交于
      ```ruby
      nil.respond_to?(:stringify_keys) # => false
      ```
      
      ```ruby
      include ActiveModel::AttributeAssignment
      Object.new.assign_attributes(nil) #  => ArgumentError: When assigning attributes, you must pass a hash as an argument.
      ```
      d1ca18d2
  11. 01 4月, 2017 1 次提交
  12. 29 3月, 2017 1 次提交
  13. 28 3月, 2017 1 次提交
    • B
      Fix ActiveModel::Errors #keys, #values · 01269aed
      bogdanvlviv 提交于
      Before:
        person.errors.keys    # => []
        person.errors.values  # => []
        person.errors[:name]  # => []
        person.errors.keys    # => [:name]
        person.errors.values  # => [[]]
      
      After:
        person.errors.keys   # => []
        person.errors.values # => []
        person.errors[:name] # => []
        person.errors.keys   # => []
        person.errors.values # => []
      
      Related to #23468
      01269aed
  14. 22 3月, 2017 1 次提交
  15. 11 3月, 2017 1 次提交
  16. 25 2月, 2017 2 次提交
  17. 24 2月, 2017 1 次提交
  18. 21 2月, 2017 1 次提交
    • P
      Fix `define_attribute_method` with Symbol in AR · 0b157f8d
      Prem Sichanugrist 提交于
      This issue is only appear when you try to call `define_attribute_method`
      and passing a symbol in Active Record. It does not appear in isolation
      in Active Model itself.
      
      Before this patch, when you run `User.define_attribute_method :foo`, you
      will get:
      
          NoMethodError: undefined method `unpack' for :foo:Symbol
              from activerecord/lib/active_record/attribute_methods/read.rb:28:in `define_method_attribute'
              from activerecord/lib/active_record/attribute_methods/primary_key.rb:61:in `define_method_attribute'
              from activemodel/lib/active_model/attribute_methods.rb:292:in `block in define_attribute_method'
              from activemodel/lib/active_model/attribute_methods.rb:285:in `each'
              from activemodel/lib/active_model/attribute_methods.rb:285:in `define_attribute_method'
      
      This patch contains both a fix in Active Model and a test in Active
      Record for this error.
      0b157f8d
  19. 18 2月, 2017 1 次提交
  20. 17 2月, 2017 1 次提交
  21. 16 2月, 2017 1 次提交
  22. 15 2月, 2017 1 次提交
  23. 13 2月, 2017 1 次提交
  24. 07 2月, 2017 2 次提交
  25. 04 2月, 2017 2 次提交
  26. 22 1月, 2017 1 次提交
    • K
      Make BigDecimal casting consistent on different platforms · 7ec30400
      Kir Shatrov 提交于
      Right now it behaves differently on JRuby:
      
      ```
      --- expected
      +++ actual
      @@ -1 +1 @@
      -#<BigDecimal:5f3c866c,'0.333333333333333333',18(20)>
      +#<BigDecimal:16e0afab,'0.3333333333333333',16(20)>
      ```
      
      My initial PR (https://github.com/rails/rails/pull/27324)
      offered to let the precision to be decided by the platform and
      change the test expection, but other contributors suggested
      that we should change the default precision in Rails
      to be consistent of all platforms.
      
      The value (18) comes from the max default precision that comes
      from casting Rational(1/3) to BigDecimal.
      7ec30400
  27. 17 1月, 2017 2 次提交
  28. 11 1月, 2017 1 次提交
  29. 05 1月, 2017 1 次提交
  30. 01 1月, 2017 3 次提交
  31. 25 12月, 2016 1 次提交