daviscabral / destroy_restricted

Prevents that related records could be removed, when set.

This URL has Read+Write access

daviscabral (author)
Sun Sep 07 15:09:07 -0700 2008
commit  ce1e2e73643cabbdeead8d4fecfd3b44a4a9229b
tree    0661b10ee6abad6a2538c66b9d765cf1ee67bb2a
parent  658ac7c1008a43a5f15ae8ba3fba64dda77abd91
README.mkdn

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