Skip to content

Instantly share code, notes, and snippets.

@hopsoft
Created March 15, 2012 04:19
Show Gist options
  • Save hopsoft/2041843 to your computer and use it in GitHub Desktop.
Save hopsoft/2041843 to your computer and use it in GitHub Desktop.
User - cancan abstract resource authorization
class User < ActiveRecord::Base
has_and_belongs_to_many :associates,
:class_name => "User",
:join_table => "connections",
:association_foreign_key => "connection_user_id"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment