Sha256: 787c1cd655cf39a99df8e615d00d682801777927e34c62821d30b5976537623e
Contents?: true
Size: 420 Bytes
Versions: 32
Compression:
Stored size: 420 Bytes
Contents
class Group < ActiveRecord::Base has_and_belongs_to_many :roles has_many :groups_users has_many :users, :through => :groups_users, :conditions => {'groups_users.granted' => true} attr_protected [] def admins users = [] perms = Permission.where(:resource_type => 'Group', :resource => name, :action => 'edit').includes(:role => :users) perms.each { |p| users += p.role.users } users end end
Version data entries
32 entries across 32 versions & 1 rubygems