1. 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
  2. 29 11月, 2017 1 次提交
  3. 28 11月, 2017 1 次提交
  4. 06 11月, 2017 1 次提交
  5. 26 10月, 2017 1 次提交
  6. 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
  7. 28 6月, 2017 1 次提交
  8. 27 5月, 2017 1 次提交
  9. 30 4月, 2017 1 次提交
  10. 29 3月, 2017 1 次提交
  11. 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
  12. 22 3月, 2017 1 次提交
  13. 24 2月, 2017 1 次提交
  14. 18 2月, 2017 1 次提交
  15. 07 2月, 2017 2 次提交
  16. 22 11月, 2016 1 次提交
  17. 15 10月, 2016 1 次提交
  18. 11 10月, 2016 2 次提交
  19. 10 5月, 2016 1 次提交
  20. 07 5月, 2016 1 次提交
  21. 06 5月, 2016 1 次提交
  22. 28 4月, 2016 1 次提交
  23. 05 4月, 2016 1 次提交
  24. 25 2月, 2016 1 次提交
  25. 02 2月, 2016 1 次提交
  26. 06 1月, 2016 1 次提交
  27. 05 1月, 2016 1 次提交
  28. 21 12月, 2015 2 次提交
  29. 19 12月, 2015 1 次提交
  30. 02 10月, 2015 1 次提交
  31. 09 9月, 2015 1 次提交
  32. 08 9月, 2015 2 次提交
  33. 01 9月, 2015 1 次提交
    • A
      Add case_sensitive option for confirmation validation · 2438a1cf
      Akshat Sharma 提交于
      Case :- 1. In case of email confirmation one needs case insensitive comparison
              2. In case of password confirmation one needs case sensitive comparison
      
      [ci skip] Update Guides for case_sensitive option in confirmation validation
      2438a1cf
  34. 07 8月, 2015 1 次提交
  35. 30 7月, 2015 1 次提交
    • D
      Validate multiple contexts on `valid?` and `invalid?` at once. · 86e3b047
      Dmitry Polushkin 提交于
      Example:
      
      ```ruby
      class Person
        include ActiveModel::Validations
      
        attr_reader :name, :title
        validates_presence_of :name, on: :create
        validates_presence_of :title, on: :update
      end
      
      person = Person.new
      person.valid?([:create, :update])    # => true
      person.errors.messages               # => {:name=>["can't be blank"], :title=>["can't be blank"]}
      ```
      86e3b047
  36. 23 5月, 2015 1 次提交