Created
November 22, 2011 07:35
-
-
Save ozzyaaron/1385111 to your computer and use it in GitHub Desktop.
Association destroy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_destroy { | |
record.associations.each do |association| | |
if association.is_has_association? | |
if record.association.exists? | |
return false | |
end | |
end | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment