class User < ActiveRecord::Base rolify has_many :unities has_many :roles, through: :unities has_many :groups, through: :unities cattr_accessor :current_role # I added current_role so I can check which role does user haves on a group that he is on but I will get to that later end