diff options
Diffstat (limited to 'guides/source/active_model_basics.textile')
-rw-r--r-- | guides/source/active_model_basics.textile | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/guides/source/active_model_basics.textile b/guides/source/active_model_basics.textile index 98b3533000..d373f4ac85 100644 --- a/guides/source/active_model_basics.textile +++ b/guides/source/active_model_basics.textile @@ -20,7 +20,7 @@ class Person attribute_method_prefix 'reset_' attribute_method_suffix '_highest?' - define_attribute_methods ['age'] + define_attribute_methods 'age' attr_accessor :age @@ -95,12 +95,11 @@ h4. Dirty An object becomes dirty when an object is gone through one or more changes to its attributes and not yet saved. This gives the ability to check whether an object has been changed or not. It also has attribute based accessor methods. Lets consider a Person class with attributes first_name and last_name <ruby> -require 'rubygems' require 'active_model' class Person include ActiveModel::Dirty - define_attribute_methods [:first_name, :last_name] + define_attribute_methods :first_name, :last_name def first_name @first_name |