mirror of https://github.com/rails/rails
Merge pull request #10192 from senny/align_expression_outputs
align the result of expressions vertically [ci skip].
This commit is contained in:
commit
70db38572a
|
@ -24,8 +24,8 @@ to integrate with Action Pack out of the box: <tt>ActiveModel::Model</tt>.
|
||||||
end
|
end
|
||||||
|
|
||||||
person = Person.new(name: 'bob', age: '18')
|
person = Person.new(name: 'bob', age: '18')
|
||||||
person.name # => 'bob'
|
person.name # => 'bob'
|
||||||
person.age # => '18'
|
person.age # => '18'
|
||||||
person.valid? # => true
|
person.valid? # => true
|
||||||
|
|
||||||
It includes model name introspections, conversions, translations and
|
It includes model name introspections, conversions, translations and
|
||||||
|
@ -82,12 +82,12 @@ behavior out of the box:
|
||||||
end
|
end
|
||||||
|
|
||||||
person = Person.new
|
person = Person.new
|
||||||
person.name # => nil
|
person.name # => nil
|
||||||
person.changed? # => false
|
person.changed? # => false
|
||||||
person.name = 'bob'
|
person.name = 'bob'
|
||||||
person.changed? # => true
|
person.changed? # => true
|
||||||
person.changed # => ['name']
|
person.changed # => ['name']
|
||||||
person.changes # => { 'name' => [nil, 'bob'] }
|
person.changes # => { 'name' => [nil, 'bob'] }
|
||||||
person.name = 'robert'
|
person.name = 'robert'
|
||||||
person.save
|
person.save
|
||||||
person.previous_changes # => {'name' => ['bob, 'robert']}
|
person.previous_changes # => {'name' => ['bob, 'robert']}
|
||||||
|
|
Loading…
Reference in New Issue