1. 14 12月, 2019 1 次提交
  2. 10 12月, 2019 1 次提交
  3. 27 11月, 2019 1 次提交
  4. 05 11月, 2019 1 次提交
  5. 01 11月, 2019 1 次提交
  6. 17 8月, 2019 1 次提交
  7. 16 8月, 2019 1 次提交
  8. 23 7月, 2019 1 次提交
  9. 25 4月, 2019 1 次提交
  10. 31 3月, 2019 1 次提交
  11. 30 3月, 2019 2 次提交
    • R
      Type cast falsy boolean symbols on boolean attribute as false · 2d12f800
      Ryuta Kamizono 提交于
      Before 34cc301f, type casting by boolean attribute when querying is a
      no-op, so finding by truthy boolean string (i.e.
      `where(value: "true") # => value = 'true'`) didn't work as expected
      (matches it to FALSE in MySQL #32624). By type casting is ensured, a
      value on boolean attribute is always serialized to TRUE or FALSE.
      
      In PostgreSQL, `where(value: :false) # => value = 'false'` was a valid
      SQL, so 34cc301f is a regresson for PostgreSQL since all symbol values
      are serialized as TRUE.
      
      I'd say using `:false` is mostly a developer's mistake (user's input
      basically comes as a string), but `:false` on boolean attribute is
      serialized as TRUE is not a desirable behavior for anybody.
      
      This allows falsy boolean symbols as false, i.e.
      `klass.create(value: :false).value? # => false` and
      `where(value: :false) # => value = FALSE`.
      
      Fixes #35676.
      2d12f800
    • P
      Rename `i18n_full_message` config option to `i18n_customize_full_message` · d8ba2f7c
      Prathamesh Sonpatki 提交于
      - I feel `i18n_customize_full_messages` explains the meaning of the
        config better.
      - Followup of https://github.com/rails/rails/pull/32956
      d8ba2f7c
  12. 12 3月, 2019 2 次提交
  13. 11 3月, 2019 1 次提交
    • E
      Prep release · 7c87fd56
      eileencodes 提交于
      * Update RAILS_VERSION
      * Bundle
      * rake update_versions
      * rake changelog:header
      7c87fd56
  14. 26 2月, 2019 1 次提交
  15. 21 1月, 2019 1 次提交
    • A
      Fix year value when casting a multiparameter time hash · ccdedeb9
      Andrew White 提交于
      When assigning a hash to a time attribute that's missing a year
      component (e.g. a `time_select` with `:ignore_date` set to `true`)
      then the year defaults to 1970 instead of the expected 2000. This
      results in the attribute changing as a result of the save.
      
      Before:
      
          event = Event.new(start_time: { 4 => 20, 5 => 30 })
          event.start_time # => 1970-01-01 20:30:00 UTC
          event.save
          event.reload
          event.start_time # => 2000-01-01 20:30:00 UTC
      
      After:
      
          event = Event.new(start_time: { 4 => 20, 5 => 30 })
          event.start_time # => 2000-01-01 20:30:00 UTC
          event.save
          event.reload
          event.start_time # => 2000-01-01 20:30:00 UTC
      ccdedeb9
  16. 19 1月, 2019 1 次提交
  17. 05 1月, 2019 1 次提交
  18. 20 12月, 2018 1 次提交
  19. 13 12月, 2018 1 次提交
  20. 21 11月, 2018 1 次提交
  21. 07 9月, 2018 1 次提交
  22. 23 8月, 2018 1 次提交
    • R
      Fix numericality validator to still use value before type cast except Active Record · 47a6d788
      Ryuta Kamizono 提交于
      The purpose of fe9547b6 is to work type casting to value from database.
      
      But that was caused not to use the value before type cast even except
      Active Record.
      
      There we never guarantees that the value before type cast was going to
      the used in this validation, but we should not change the behavior
      unless there is some particular reason.
      
      To restore original behavior, still use the value before type cast if
      `came_from_user?` is undefined (i.e. except Active Record).
      
      Fixes #33651.
      Fixes #33686.
      47a6d788
  23. 12 8月, 2018 1 次提交
  24. 08 7月, 2018 1 次提交
  25. 12 6月, 2018 1 次提交
  26. 14 3月, 2018 1 次提交
  27. 28 2月, 2018 1 次提交
  28. 18 2月, 2018 1 次提交
  29. 31 1月, 2018 1 次提交
  30. 24 1月, 2018 1 次提交
    • S
      Allow attributes with a proc default to be marshalled · 0af36c62
      Sean Griffin 提交于
      We don't implement much custom marshalling logic for these objects, but
      the proc default case needs to be handled separately. Unfortunately
      there's no way to just say "do what you would have done but with this
      value for one ivar", so we have to manually implement `marshal_load` as
      well.
      
      The test case is a little bit funky, but I'd really like an equality
      test in there, and there's no easy way to add one now that this is out
      of AR (since the `attributes` method isn't here)
      
      Fixes #31216
      0af36c62
  31. 19 12月, 2017 1 次提交
    • Y
      Fix validation callbacks on multiple context · 470d0e45
      Yoshiyuki Hirano 提交于
      I found a bug that validation callbacks don't fire on multiple context.
      So I've fixed it.
      
      Example:
      
      ```ruby
      class Dog
        include ActiveModel::Validations
        include ActiveModel::Validations::Callbacks
      
        attr_accessor :history
      
        def initialize
          @history = []
        end
      
        before_validation :set_before_validation_on_a, on: :a
        before_validation :set_before_validation_on_b, on: :b
        after_validation :set_after_validation_on_a, on: :a
        after_validation :set_after_validation_on_b, on: :b
      
        def set_before_validation_on_a; history << "before_validation on a"; end
        def set_before_validation_on_b; history << "before_validation on b"; end
        def set_after_validation_on_a;  history << "after_validation on a" ; end
        def set_after_validation_on_b;  history << "after_validation on b" ; end
      end
      ```
      
      Before:
      
      ```
      d = Dog.new
      d.valid?([:a, :b])
      d.history # []
      ```
      
      After:
      
      ```
      d = Dog.new
      d.valid?([:a, :b])
      d.history # ["before_validation on a", "before_validation on b", "after_validation on a", "after_validation on b"]
      ```
      470d0e45
  32. 18 12月, 2017 1 次提交
    • S
      Return correct date in ActiveModel for time to date conversions · eb73dfc0
      Sayan Chakraborty 提交于
      time.to_date conversion happens considering leap years
      so a conversion of "Day.new({'day(1i)'=>'1', 'day(2i)'=>'1', 'day(3i)'=>'1'})" results in saving the date as Mon, 03 Jan 0001
      which might seem weird on the user level, hence falling back to parsing on string level resolves this data mismatch
      Fixes #28521
      eb73dfc0
  33. 29 11月, 2017 1 次提交
  34. 28 11月, 2017 1 次提交
  35. 06 11月, 2017 1 次提交
  36. 26 10月, 2017 1 次提交
  37. 08 7月, 2017 1 次提交
    • J
      Add ActiveModel::Errors#merge! · 3650ca98
      Jahfer Husain 提交于
      ActiveModel::Errors#merge! allows ActiveModel::Errors to append errors from
      a separate ActiveModel::Errors instance onto their own.
      
      Example:
      
          person = Person.new
          person.errors.add(:name, :blank)
      
          errors = ActiveModel::Errors.new(Person.new)
          errors.add(:name, :invalid)
      
          person.errors.merge!(errors)
          puts person.errors.messages
          # => { name: ["can't be blank", "is invalid"] }
      3650ca98
  38. 28 6月, 2017 1 次提交