diff options
| author | Leonel Galán <leonel@getstealz.com> | 2017-05-17 15:23:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-17 15:23:21 -0400 |
| commit | 0804e58e1e6a52190a950f863622102b6b21ccb8 (patch) | |
| tree | a2d9887906bd2c472edc54907362b93a57f52f0f /activemodel/lib/active_model/validations | |
| parent | f5b2a0ef408f01dd9f12b456f5e4bb41ebb4cb76 (diff) | |
| parent | 385d9af299fbfac7f063de214d371545bafef5df (diff) | |
| download | rails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.gz rails-0804e58e1e6a52190a950f863622102b6b21ccb8.tar.bz2 rails-0804e58e1e6a52190a950f863622102b6b21ccb8.zip | |
Merge branch 'master' into bug/filtered_parameters_class
Diffstat (limited to 'activemodel/lib/active_model/validations')
| -rw-r--r-- | activemodel/lib/active_model/validations/validates.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/validates.rb b/activemodel/lib/active_model/validations/validates.rb index 0ce5935f3a..a8b958e974 100644 --- a/activemodel/lib/active_model/validations/validates.rb +++ b/activemodel/lib/active_model/validations/validates.rb @@ -18,7 +18,6 @@ module ActiveModel # validates :first_name, length: { maximum: 30 } # validates :age, numericality: true # validates :username, presence: true - # validates :username, uniqueness: true # # The power of the +validates+ method comes when using custom validators # and default validators in one call for a given attribute. @@ -34,7 +33,7 @@ module ActiveModel # include ActiveModel::Validations # attr_accessor :name, :email # - # validates :name, presence: true, uniqueness: true, length: { maximum: 100 } + # validates :name, presence: true, length: { maximum: 100 } # validates :email, presence: true, email: true # end # @@ -94,7 +93,7 @@ module ActiveModel # Example: # # validates :password, presence: true, confirmation: true, if: :password_required? - # validates :token, uniqueness: true, strict: TokenGenerationException + # validates :token, length: 24, strict: TokenLengthException # # # Finally, the options +:if+, +:unless+, +:on+, +:allow_blank+, +:allow_nil+, +:strict+ |
