Displaying 1 result from an estimated 1 matches for "lastusercantbedeleted".
2006 Feb 18
5
don''t destroy last user
How would I stop the last user being deleted.
The following code doesn''t work.
before_destroy :dont_destroy_last_user
# Don''t delete user if it the last one
def dont_destroy_last_User
raise "Can''t destroy last user" if User.length < 1
end
--
Posted via http://www.ruby-forum.com/.