class Group < ActiveRecord::Base has_many :unities has_many :users, through: :unities has_many :roles, through: :unities cattr_accessor :current # here I added a current group, so I can check wich group is active I will use that later. end