diff options
author | Xavier Noria <fxn@hashref.com> | 2015-02-06 09:36:28 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2015-02-06 09:36:28 +0100 |
commit | 4af4cead151055d15ca4d6942c3e66318ca72758 (patch) | |
tree | c44ffc8c47dc62feea54c19dd5be12f8c2154bd8 | |
parent | 25bbe595f1dda1378238a4698b5f980a24110c75 (diff) | |
download | rails-4af4cead151055d15ca4d6942c3e66318ca72758.tar.gz rails-4af4cead151055d15ca4d6942c3e66318ca72758.tar.bz2 rails-4af4cead151055d15ca4d6942c3e66318ca72758.zip |
applies guidelines to dirty.rb [ci skip]
-rw-r--r-- | activemodel/lib/active_model/dirty.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index 977cccf5d0..283dbf0586 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -59,7 +59,7 @@ module ActiveModel # A newly instantiated object is unchanged: # # person = Person.new 'Uncle Bob' - # person.changed? # => false + # person.changed? # => false # # Change the name: # @@ -75,8 +75,8 @@ module ActiveModel # Save the changes: # # person.save - # person.changed? # => false - # person.name_changed? # => false + # person.changed? # => false + # person.name_changed? # => false # # Reset the changes: # @@ -88,20 +88,20 @@ module ActiveModel # # person.name = "Uncle Bob" # person.rollback! - # person.name # => "Bill" - # person.name_changed? # => false + # person.name # => "Bill" + # person.name_changed? # => false # # Assigning the same value leaves the attribute unchanged: # # person.name = 'Bill' - # person.name_changed? # => false - # person.name_change # => nil + # person.name_changed? # => false + # person.name_change # => nil # # Which attributes have changed? # # person.name = 'Bob' - # person.changed # => ["name"] - # person.changes # => {"name" => ["Bill", "Bob"]} + # person.changed # => ["name"] + # person.changes # => {"name" => ["Bill", "Bob"]} # # If an attribute is modified in-place then make use of # +[attribute_name]_will_change!+ to mark that the attribute is changing. @@ -110,9 +110,9 @@ module ActiveModel # not need to call +[attribute_name]_will_change!+ on Active Record models. # # person.name_will_change! - # person.name_change # => ["Bill", "Bill"] + # person.name_change # => ["Bill", "Bill"] # person.name << 'y' - # person.name_change # => ["Bill", "Billy"] + # person.name_change # => ["Bill", "Billy"] module Dirty extend ActiveSupport::Concern include ActiveModel::AttributeMethods |