aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/migrations.textile
diff options
context:
space:
mode:
authoreparreno <emili@eparreno.com>2010-11-15 19:21:40 +0100
committereparreno <emili@eparreno.com>2010-11-15 19:21:40 +0100
commit04775a41cbbddceeffa9cf8590566b9990fd4070 (patch)
treefadc43711f43f858605c7c2c09d20c2d0960d293 /railties/guides/source/migrations.textile
parente7723baa0b904787bde363f55912f7e71aa4517d (diff)
downloadrails-04775a41cbbddceeffa9cf8590566b9990fd4070.tar.gz
rails-04775a41cbbddceeffa9cf8590566b9990fd4070.tar.bz2
rails-04775a41cbbddceeffa9cf8590566b9990fd4070.zip
remove old school validations and replaced with new validates method. Pending: fix active_record guide
Diffstat (limited to 'railties/guides/source/migrations.textile')
-rw-r--r--railties/guides/source/migrations.textile2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile
index 4c49a4ccbc..61d457e351 100644
--- a/railties/guides/source/migrations.textile
+++ b/railties/guides/source/migrations.textile
@@ -584,7 +584,7 @@ h3. Active Record and Referential Integrity
The Active Record way claims that intelligence belongs in your models, not in the database. As such, features such as triggers or foreign key constraints, which push some of that intelligence back into the database, are not heavily used.
-Validations such as +validates_uniqueness_of+ are one way in which models can enforce data integrity. The +:dependent+ option on associations allows models to automatically destroy child objects when the parent is destroyed. Like anything which operates at the application level these cannot guarantee referential integrity and so some people augment them with foreign key constraints.
+Validations such as +validates :foreign_key, :uniqueness => true+ are one way in which models can enforce data integrity. The +:dependent+ option on associations allows models to automatically destroy child objects when the parent is destroyed. Like anything which operates at the application level these cannot guarantee referential integrity and so some people augment them with foreign key constraints.
Although Active Record does not provide any tools for working directly with such features, the +execute+ method can be used to execute arbitrary SQL. There are also a number of plugins such as "foreign_key_migrations":http://github.com/harukizaemon/redhillonrails/tree/master/foreign_key_migrations/ which add foreign key support to Active Record (including support for dumping foreign keys in +db/schema.rb+).