1. 21 2月, 2015 2 次提交
  2. 20 2月, 2015 1 次提交
  3. 16 2月, 2015 1 次提交
  4. 05 2月, 2015 1 次提交
  5. 22 1月, 2015 1 次提交
  6. 21 1月, 2015 1 次提交
    • W
      Add ActiveModel::Errors#details · cb74473d
      Wojciech Wnętrzak 提交于
      To be able to return type of validator, one can now call `details`
      on Errors instance:
      
      ```ruby
      class User < ActiveRecord::Base
        validates :name, presence: true
      end
      ```
      
      ```ruby
      user = User.new; user.valid?; user.errors.details
      => {name: [{error: :blank}]}
      ```
      cb74473d
  7. 14 1月, 2015 1 次提交
  8. 24 12月, 2014 1 次提交
  9. 10 12月, 2014 1 次提交
  10. 29 10月, 2014 1 次提交
  11. 25 10月, 2014 1 次提交
  12. 19 10月, 2014 2 次提交
  13. 16 10月, 2014 1 次提交
  14. 04 10月, 2014 1 次提交
  15. 11 7月, 2014 1 次提交
  16. 03 7月, 2014 1 次提交
  17. 22 5月, 2014 1 次提交
  18. 20 5月, 2014 1 次提交
  19. 09 2月, 2014 2 次提交
  20. 04 2月, 2014 1 次提交
  21. 25 1月, 2014 1 次提交
  22. 01 12月, 2013 1 次提交
  23. 12 11月, 2013 1 次提交
  24. 15 10月, 2013 1 次提交
    • S
      Remove size alias for length validation · a94186f8
      Sıtkı Bağdat 提交于
      Removed ```The `size` helper is an alias for `length`.``` line. If you use this "nonexist" helper, you will get an error message like this: 
      
      ```
      ArgumentError: Unknown validator: 'SizeValidator'
      ...
      ```
      
      Maybe wanted to mean ```validates_size_of``` helper as an alias for ```validates_length_of``` helper.
      a94186f8
  25. 12 10月, 2013 1 次提交
    • S
      Fix a writing mistake · 464def3e
      Sıtkı Bağdat 提交于
      A small mistake found in the line of ```The default error is "can't be empty"``` for ```:presence``` helper. ```empty``` word changed to ```blank```.
      464def3e
  26. 09 10月, 2013 1 次提交
  27. 23 8月, 2013 1 次提交
  28. 04 8月, 2013 1 次提交
    • T
      Fix active_record_validations.md document, `:save` for `on:` validation helper was never available · 740f7787
      Takehiro Adachi 提交于
      According to the guide, ":save" value for the "on:" validation helper
      was available like below
      
          validates :name, presence: true, on: :save
      
      but this was never available according to the implementation of the
      valid? method, which is below
      
          # Runs all the validations within the specified context. Returns
      +true+ if
          # no errors are found, +false+ otherwise.
          #
          # If the argument is +false+ (default is +nil+), the context is set
      to <tt>:create</tt> if
          # <tt>new_record?</tt> is +true+, and to <tt>:update</tt> if it is
      not.
          #
          # Validations with no <tt>:on</tt> option will run no matter the
      context. Validations with
          # some <tt>:on</tt> option will only run in the specified context.
          def valid?(context = nil)
            context ||= (new_record? ? :create : :update)
            output = super(context)
            errors.empty? && output
          end
      
      So the documentation was always wrong since the PR proposed by
      @neerajdotname  ( #10287 ) was rejected.
      740f7787
  29. 19 7月, 2013 1 次提交
  30. 20 6月, 2013 1 次提交
  31. 13 6月, 2013 1 次提交
  32. 09 6月, 2013 1 次提交
  33. 28 5月, 2013 2 次提交
  34. 17 5月, 2013 1 次提交
  35. 22 4月, 2013 2 次提交