Easy and auto-magically done with some Rails goodness:
class User < ActiveRecord::Base
has_many :user_friends, :dependent => :destroy
end
Deleting a User will then perform a cascaded delete of the dependent user_friends when the User is destroyed.
posted on 2013-04-25 00:00:00 UTC
| Topic | localhost |
|---|---|
| Tags | Rails |
Example usage:
request.env["HTTP_USER_AGENT"]