diff options
-rw-r--r-- | activemodel/lib/active_model/validations.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb index 243d911f71..a3b87daadb 100644 --- a/activemodel/lib/active_model/validations.rb +++ b/activemodel/lib/active_model/validations.rb @@ -233,7 +233,7 @@ module ActiveModel # # person = Person.new # person.valid? # => false - # person.errors # => #<ActiveModel::Errors:0x007fe603816640 @messages={:name=>["can't be blank"]}> + # person.errors # => #<ActiveModel::Errors:0x007fe603816640 @messages={:name=>["can't be blank"]}> def errors @errors ||= Errors.new(self) end @@ -250,7 +250,7 @@ module ActiveModel # # person = Person.new # person.name = '' - # person.valid? # => false + # person.valid? # => false # person.name = 'david' # person.valid? # => true # @@ -265,7 +265,7 @@ module ActiveModel # end # # person = Person.new - # person.valid? # => true + # person.valid? # => true # person.valid?(:new) # => false def valid?(context = nil) current_context, self.validation_context = validation_context, context @@ -287,7 +287,7 @@ module ActiveModel # # person = Person.new # person.name = '' - # person.invalid? # => true + # person.invalid? # => true # person.name = 'david' # person.invalid? # => false # @@ -302,7 +302,7 @@ module ActiveModel # end # # person = Person.new - # person.invalid? # => false + # person.invalid? # => false # person.invalid?(:new) # => true def invalid?(context = nil) !valid?(context) |