diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-09-03 01:40:00 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-09-03 01:40:00 +0530 |
commit | f83f169b85eea4f580ae95609506fbb3cc5b8ccb (patch) | |
tree | 045bcbd8266f74dae841444ae8811393397559f6 /railties | |
parent | 78497c7c27879aa735db24377f056de96a260bb9 (diff) | |
download | rails-f83f169b85eea4f580ae95609506fbb3cc5b8ccb.tar.gz rails-f83f169b85eea4f580ae95609506fbb3cc5b8ccb.tar.bz2 rails-f83f169b85eea4f580ae95609506fbb3cc5b8ccb.zip |
some of the changes for validation earlier reverted from d20281a
Diffstat (limited to 'railties')
-rw-r--r-- | railties/guides/source/active_model_basics.textile | 2 | ||||
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 4 | ||||
-rw-r--r-- | railties/guides/source/performance_testing.textile | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/railties/guides/source/active_model_basics.textile b/railties/guides/source/active_model_basics.textile index 0672669dc5..73df567579 100644 --- a/railties/guides/source/active_model_basics.textile +++ b/railties/guides/source/active_model_basics.textile @@ -163,12 +163,14 @@ person.first_name_changed? #=> true </ruby> Track what was the previous value of the attribute. + <ruby> #attr_name_was accessor person.first_name_was #=> "First Name" </ruby> Track both previous and current value of the changed attribute. Returns an array if changed else returns nil + <ruby> #attr_name_change person.first_name_change #=> ["First Name", "First Name 1"] diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 4e77a6e803..95a7bfebc3 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -132,7 +132,7 @@ SELECT * FROM clients ORDER BY clients.id DESC LIMIT 1 <tt>Model.last</tt> returns +nil+ if no matching record is found. No exception will be raised. -h5. +first!+ +h5(#first_1). +first!+ <tt>Model.first!</tt> finds the first record. For example: @@ -149,7 +149,7 @@ SELECT * FROM clients LIMIT 1 <tt>Model.first!</tt> raises +RecordNotFound+ if no matching record is found. -h5. +last!+ +h5(#last_1). +last!+ <tt>Model.last!</tt> finds the last record. For example: diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile index 75f81cf13d..5947735deb 100644 --- a/railties/guides/source/performance_testing.textile +++ b/railties/guides/source/performance_testing.textile @@ -207,7 +207,7 @@ GC Time measures the amount of time spent in GC for the performance test case. h5. Metric Availability -h6. Benchmarking +h6(#benchmarking_1). Benchmarking |_.Interpreter|_.Wall Time|_.Process Time|_.CPU Time|_.User Time|_.Memory|_.Objects|_.GC Runs|_.GC Time| |_.MRI | yes | yes | yes | no | yes | yes | yes | yes | @@ -215,7 +215,7 @@ h6. Benchmarking |_.Rubinius | yes | no | no | no | yes | yes | yes | yes | |_.JRuby | yes | no | no | yes | yes | yes | yes | yes | -h6. Profiling +h6(#profiling_1). Profiling |_.Interpreter|_.Wall Time|_.Process Time|_.CPU Time|_.User Time|_.Memory|_.Objects|_.GC Runs|_.GC Time| |_.MRI | yes | yes | no | no | yes | yes | yes | yes | |