Sha256: e7a137af29d52444eb1a63ebcb5cf0897fbe3206f20f39f9532db39b72d1fb25

Contents?: true

Size: 819 Bytes

Versions: 5

Compression:

Stored size: 819 Bytes

Contents

= dependent => :protect option

Adds a new option :protect for the parameter <tt>:depends</tt> from +has_many+
method. This option forbids destroying records with associated records in a
association created with <tt>:dependent => :protect</tt> option, more or less
like <tt>ON DELETE RESTRICT</tt> SQL statement. If you try to destroy a record with
associated records it will raise a
ActiveRecord::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@yahoo.es>, based on the ideas and
the code from <diego.algorta@gmail.com>.

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dependent_protect-0.0.6 README.md
dependent_protect-0.0.5 README.md
dependent_protect-0.0.4 README.md
dependent_protect-0.0.3 README.md
dependent_protect-0.0.2 README.md