diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-25 20:41:35 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-10-25 20:41:35 -0500 |
commit | 9ac095fef586bcf86ed10d31acbc4af2abb53843 (patch) | |
tree | b89cc16129b877ad770e6aabc0cca003a31fbc24 /activemodel/lib/active_model/validations/validates.rb | |
parent | 65be1a0e7a93b2f4e308739d55516be0c58543df (diff) | |
download | rails-9ac095fef586bcf86ed10d31acbc4af2abb53843.tar.gz rails-9ac095fef586bcf86ed10d31acbc4af2abb53843.tar.bz2 rails-9ac095fef586bcf86ed10d31acbc4af2abb53843.zip |
minor edits and remove mixed titles in AM::Validations docs [ci skip]
Diffstat (limited to 'activemodel/lib/active_model/validations/validates.rb')
-rw-r--r-- | activemodel/lib/active_model/validations/validates.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb index 03046a543a..4651154934 100644 --- a/activemodel/lib/active_model/validations/validates.rb +++ b/activemodel/lib/active_model/validations/validates.rb @@ -1,7 +1,6 @@ require 'active_support/core_ext/hash/slice' module ActiveModel - # == Active Model validates method module Validations module ClassMethods # This method is a shortcut to all default validators and any custom @@ -129,15 +128,15 @@ module ActiveModel # the validation itself. # # class Person - # include ActiveModel::Validations + # include ActiveModel::Validations # # attr_accessor :name # validates! :name, presence: true # end # # person = Person.new - # person.name = '' - # person.valid? + # person.name = '' + # person.valid? # # => ActiveModel::StrictValidationFailed: Name can't be blank def validates!(*attributes) options = attributes.extract_options! @@ -149,11 +148,11 @@ module ActiveModel # When creating custom validators, it might be useful to be able to specify # additional default keys. This can be done by overwriting this method. - def _validates_default_keys #:nodoc: + def _validates_default_keys # :nodoc: [:if, :unless, :on, :allow_blank, :allow_nil , :strict] end - def _parse_validates_options(options) #:nodoc: + def _parse_validates_options(options) # :nodoc: case options when TrueClass {} |