1. 12 9月, 2012 1 次提交
  2. 07 9月, 2012 1 次提交
  3. 25 8月, 2012 1 次提交
  4. 06 8月, 2012 1 次提交
  5. 03 8月, 2012 2 次提交
  6. 30 7月, 2012 4 次提交
  7. 21 7月, 2012 3 次提交
  8. 10 7月, 2012 1 次提交
  9. 06 7月, 2012 2 次提交
  10. 05 7月, 2012 1 次提交
  11. 27 6月, 2012 2 次提交
  12. 26 6月, 2012 1 次提交
  13. 15 6月, 2012 1 次提交
  14. 12 6月, 2012 1 次提交
  15. 28 5月, 2012 1 次提交
    • S
      Don't enable validations when passing false hash values to ActiveModel.validates · b3ccd7b2
      Steve Purcell 提交于
      Passing a falsey option value for a validator currently causes that validator to
      be enabled, just like "true":
      
          ActiveModel.validates :foo, :presence => false
      
      This is rather counterintuitive, and makes it inconvenient to wrap `validates` in
      methods which may conditionally enable different validators.
      
      As an example, one is currently forced to write:
      
            def has_slug(source_field, options={:unique => true})
              slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
              before_validation slugger
              validations = { :presence => true, :slug => true }
              if options[:unique]
                validations[:uniqueness] = true
              end
              validates :slug, validations
            end
      
      because the following reasonable-looking alternative fails to work as expected:
      
            def has_slug(source_field, options={:unique => true})
              slugger = Proc.new { |r| r[:slug] = self.class.sluggify(r[source_field]) if r[:slug].blank? }
              before_validation slugger
              validates :slug, :presence => true, :slug => true, :uniqueness => options[:unique]
            end
      
      (This commit includes a test, and all activemodel and activerecord tests pass as before.)
      b3ccd7b2
  16. 24 5月, 2012 1 次提交
    • V
      Revert "Remove blank trailing comments" · 1ad0b378
      Vijay Dev 提交于
      This reverts commit fa6d921e.
      
      Reason: Not a fan of such massive changes. We usually close such changes
      if made to Rails master as a pull request. Following the same principle
      here and reverting.
      
      [ci skip]
      1ad0b378
  17. 20 5月, 2012 1 次提交
    • H
      Remove blank trailing comments · fa6d921e
      Henrik Hodne 提交于
      For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace
      with the first match, and voilà! Note that the regex matches a little bit too
      much, so you probably want to `git add -i .` and go through every single diff
      to check if it actually should be changed.
      fa6d921e
  18. 16 5月, 2012 4 次提交
  19. 26 4月, 2012 1 次提交
  20. 24 4月, 2012 2 次提交
    • B
      Support i18n attributes for confirmation · 4433b1a9
      Brian Cardarella 提交于
      4433b1a9
    • B
      confirmation validation error attribute · fcc534ed
      Brian Cardarella 提交于
      This will render the error message on :#{attribute}_confirmation instead
      of on attribute itself. When rendering confirmation errors inline on the
      form with form builders such as SimpleForm and Formtastic it is
      confusing to the ender user to see the confirmation error message on the
      attribute element. Instead it makes more sense to have this validation
      error render on the confirmation field instead.
      
      The i18n message has been updated for the confirmation validator error
      message to include the original attribute name.
      fcc534ed
  21. 15 4月, 2012 1 次提交
  22. 29 3月, 2012 1 次提交
  23. 22 2月, 2012 1 次提交
  24. 14 2月, 2012 1 次提交
  25. 06 2月, 2012 1 次提交
    • N
      To infinity… and beyond! · 60dad828
      Niels Ganser 提交于
      Allow infinite values for validates_length_of. Particularly useful
      for prettily defining an open ended range such as
      
      validates_length_of :human_stupidity, :within => 0..Float::INFINITY
      60dad828
  26. 03 2月, 2012 1 次提交
  27. 02 2月, 2012 1 次提交
  28. 01 2月, 2012 1 次提交