From 8d775d5f1d58e5c0d881383e8c6e869d1d360c8c Mon Sep 17 00:00:00 2001 From: Manuel Menezes de Sequeira Date: Wed, 5 Oct 2011 22:14:41 +0100 Subject: Correction of code snippet tag from shell to ruby. --- railties/guides/source/active_record_validations_callbacks.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 600681ddd3..9346a408e0 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -46,7 +46,7 @@ end We can see how it works by looking at some +rails console+ output: - + >> p = Person.new(:name => "John Doe") => # >> p.new_record? @@ -55,7 +55,7 @@ We can see how it works by looking at some +rails console+ output: => true >> p.new_record? => false - + Creating and saving a new record will send an SQL +INSERT+ operation to the database. Updating an existing record will send an SQL +UPDATE+ operation instead. Validations are typically run before these commands are sent to the database. If any validations fail, the object will be marked as invalid and Active Record will not perform the +INSERT+ or +UPDATE+ operation. This helps to avoid storing an invalid object in the database. You can choose to have specific validations run when an object is created, saved, or updated. -- cgit v1.2.3