diff options
author | Alex Johnson <notalexjohnson@gmail.com> | 2013-11-12 19:23:42 +0530 |
---|---|---|
committer | Alex Johnson <notalexjohnson@gmail.com> | 2013-11-12 19:23:50 +0530 |
commit | b9a4560d91d382600164e69cf98d8eb6688447df (patch) | |
tree | 2970021a697685640756328885b22a2d8dd0c68b /guides/source/active_record_validations.md | |
parent | 5735a77def338125738c6de9c72961bb4df49513 (diff) | |
download | rails-b9a4560d91d382600164e69cf98d8eb6688447df.tar.gz rails-b9a4560d91d382600164e69cf98d8eb6688447df.tar.bz2 rails-b9a4560d91d382600164e69cf98d8eb6688447df.zip |
[ci skip] Replace #=> with # =>
Diffstat (limited to 'guides/source/active_record_validations.md')
-rw-r--r-- | guides/source/active_record_validations.md | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index 0df52a655f..cbd1ac9bdf 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -175,28 +175,28 @@ class Person < ActiveRecord::Base end >> p = Person.new -#=> #<Person id: nil, name: nil> +# => #<Person id: nil, name: nil> >> p.errors.messages -#=> {} +# => {} >> p.valid? -#=> false +# => false >> p.errors.messages -#=> {name:["can't be blank"]} +# => {name:["can't be blank"]} >> p = Person.create -#=> #<Person id: nil, name: nil> +# => #<Person id: nil, name: nil> >> p.errors.messages -#=> {name:["can't be blank"]} +# => {name:["can't be blank"]} >> p.save -#=> false +# => false >> p.save! -#=> ActiveRecord::RecordInvalid: Validation failed: Name can't be blank +# => ActiveRecord::RecordInvalid: Validation failed: Name can't be blank >> Person.create! -#=> ActiveRecord::RecordInvalid: Validation failed: Name can't be blank +# => ActiveRecord::RecordInvalid: Validation failed: Name can't be blank ``` `invalid?` is simply the inverse of `valid?`. It triggers your validations, |