1. 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
  2. 28 6月, 2017 1 次提交
  3. 27 5月, 2017 1 次提交
  4. 30 4月, 2017 1 次提交
  5. 29 3月, 2017 1 次提交
  6. 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
  7. 22 3月, 2017 1 次提交
  8. 24 2月, 2017 1 次提交
  9. 18 2月, 2017 1 次提交
  10. 07 2月, 2017 2 次提交
  11. 22 11月, 2016 1 次提交
  12. 15 10月, 2016 1 次提交
  13. 11 10月, 2016 2 次提交
  14. 10 5月, 2016 1 次提交
  15. 07 5月, 2016 1 次提交
  16. 06 5月, 2016 1 次提交
  17. 28 4月, 2016 1 次提交
  18. 05 4月, 2016 1 次提交
  19. 25 2月, 2016 1 次提交
  20. 02 2月, 2016 1 次提交
  21. 06 1月, 2016 1 次提交
  22. 05 1月, 2016 1 次提交
  23. 21 12月, 2015 2 次提交
  24. 19 12月, 2015 1 次提交
  25. 02 10月, 2015 1 次提交
  26. 09 9月, 2015 1 次提交
  27. 08 9月, 2015 2 次提交
  28. 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
  29. 07 8月, 2015 1 次提交
  30. 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
  31. 23 5月, 2015 1 次提交
  32. 29 4月, 2015 1 次提交
  33. 22 4月, 2015 2 次提交
  34. 05 4月, 2015 1 次提交
  35. 30 3月, 2015 1 次提交
    • S
      Deprecate the `:tokenizer` option to `validates_length_of` · 1c341eb7
      Sean Griffin 提交于
      As demonstrated by #19570, this option is severely limited, and
      satisfies an extremely specific use case. Realistically, there's not
      much reason for this option to exist. Its functionality can be trivially
      replicated with a normal Ruby method. Let's deprecate this option, in
      favor of the simpler solution.
      1c341eb7