Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adds dependent protect option to rails associations
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
MIT-LICENSE
README
Rakefile
init.rb

README

= dependent => :protect option

Adds a new option :protect for the parameter <tt>:depends</tt> from +has_many+,
+has_one+ and +belongs_to+ methods. This option forbids destroying records with
associated records in an 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 an
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) and plugin from Daniel
Rodríguez Troitiño <drodrigueztroitino@yahoo.es> in
http://svn.ruido-blanco.net/dependent_protect/


== Author

Sergio Cambra, based in a plugin from Daniel Rodríguez Troitiño
<drodrigueztroitino@yahoo.es>, and the ideas and the code from
<diego.algorta@gmail.com>.
Something went wrong with that request. Please try again.