Skip to content

Instantly share code, notes, and snippets.

View mongrelion's full-sized avatar

Carlos León mongrelion

View GitHub Profile
@mongrelion
mongrelion / role.rb
Created August 9, 2011 03:45
Dynamic Role methods for Role and User models
class Role < ActiveRecord::Base
ROLES = [ :group_admin, :agency_admin ]
# - Relationships -
has_many :user_roles
has_many :users, :through => :user_roles
# - Class Methods -
class << self