aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/README
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-01-16 23:03:20 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-01-16 23:03:20 +1100
commit4a2d2ef91a99602dc12acc73b20920a4382504d0 (patch)
treee484b99a69ffd1ad69270531265ecd6e78a0446f /activemodel/README
parentdb274a02edf0b7057342de308b42ecf7f9ca4181 (diff)
downloadrails-4a2d2ef91a99602dc12acc73b20920a4382504d0.tar.gz
rails-4a2d2ef91a99602dc12acc73b20920a4382504d0.tar.bz2
rails-4a2d2ef91a99602dc12acc73b20920a4382504d0.zip
Adding RDoc for active_model dirty
Diffstat (limited to 'activemodel/README')
-rw-r--r--activemodel/README31
1 files changed, 5 insertions, 26 deletions
diff --git a/activemodel/README b/activemodel/README
index 0c558ed85a..7c9c754a8e 100644
--- a/activemodel/README
+++ b/activemodel/README
@@ -9,9 +9,8 @@ duplication and fragile applications that broke on upgrades.
Active Model is a solution for this problem.
Active Model provides a known set of interfaces that your objects can implement
-to then present a common interface to the Action Pack helpers.
-
-You can include functionality from the following modules:
+to then present a common interface to the Action Pack helpers. You can include
+functionality from the following modules:
* Adding callbacks to your class
@@ -41,28 +40,7 @@ You can include functionality from the following modules:
* Tracking changes in your object
- class Person
- include ActiveModel::Dirty
-
- define_attribute_methods [:name]
-
- def name
- @name
- end
-
- def name=(val)
- name_will_change!
- @name = val
- end
-
- def save
- @previously_changed = changes
- true
- end
-
- end
-
- ...provides all the value tracking features implemented by ActiveRecord
+ Provides all the value tracking features implemented by ActiveRecord...
person = Person.new
person.name # => nil
@@ -75,4 +53,5 @@ You can include functionality from the following modules:
person.save
person.previous_changes # => {'name' => ['bob, 'robert']}
- {Learn more}[link:classes/ActiveModel/Dirty.html]
+ {Learn more}[link:classes/ActiveModel/Dirty.html]
+