Skip to content

Commit

Permalink
Update information about foreign key plugins support in the guides
Browse files Browse the repository at this point in the history
There is not "a number" of up-to-date maintained plugins for dealing with foreign keys.

The foreign_key_migrations does not have any update since 2009 and is also about to be removed:

Extracted from http://www.harukizaemon.com/2009/09/plugins-grab-em-while-theyre-stale.html,
referenced in the plugin reference of the old guide version:

"And so it is that I will very shortly (within the next month) delete most of the plugins from
my GitHub account (harukizaemon)"
  • Loading branch information
rosenfeld committed Nov 28, 2011
1 parent e7dff9c commit 6d05c79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/guides/source/migrations.textile
Original file line number Diff line number Diff line change
Expand Up @@ -670,4 +670,4 @@ The Active Record way claims that intelligence belongs in your models, not in th

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":https://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+).
Although Active Record does not provide any tools for working directly with such features, the +execute+ method can be used to execute arbitrary SQL. You could also use some plugin like "foreigner":https://github.com/matthuhiggins/foreigner which add foreign key support to Active Record (including support for dumping foreign keys in +db/schema.rb+).

0 comments on commit 6d05c79

Please sign in to comment.