public
Description: Prevents that related records could be removed, when set.
Homepage: http://forum.rubyonbr.org/forums/14/topics/613
Clone URL: git://github.com/daviscabral/destroy_restricted.git
destroy_restricted / README.mkdn
100644 15 lines (9 sloc) 0.546 kb

DestroyRestricted

By default the rails allows only that the keys are defined with null or that the register be removed together. This plugin prevents that related records could be removed, when set.

That initial proposal was created by Daniel Gatis and Rafael Ribeiro da Silva and transformed into a plugin by Davis Zanetti Cabral.

Simple Example

    class Category < ActiveRecord::Base
            has_many :products, :dependent => :restrict
    end

Copyright (c) 2008 Davis Zanetti Cabral, released under the MIT license