Browse the Ruby on Rails Community.

You are here: Browse Railsplugins Dependent Protect 20060731

Dependent Protect 20060731

dependent => :protect option

Adds a new option :protect for the parameter :depends from has_many method. This option forbids destroying records with associated records in a association created with :dependent => :protect option, more or less like “ON DELETE RESTRICTSQL statement. If you try to destroy a record with associated records it will raise a ReferentialIntegrityProtectionError (defined also in this plugin).

Based on the idea and the code from diego.algorta@gmail.com in Ruby on Rails ticket #3837 (http://dev.rubyonrails.org/ticket/3837).

You can download this plugin at:

http://svn.ruido-blanco.net/dependent_protect/trunk

Author

Daniel Rodríguez Troitiño <drodrigueztroitino>, based on the ideas and the code from <diego>.

NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly