Sha256: 94ab8883882528fa1ca2548d7c147204fd694764160ffc9109d9c02cb84dba2b
Contents?: true
Size: 484 Bytes
Versions: 46
Compression:
Stored size: 484 Bytes
Contents
class Role < ActiveRecord::Base has_many :users has_many :access_control_entries def self.root @root ||= find_by_name("Super") end def self.nobody @nobody ||= find_by_name("Nobody") end def self.user @user ||= find_by_name("User") end def self.admin @admin ||= find_by_name("Admin") end def self.collection_entries roles = [["Not Set", nil]] Role.all.map{|t| [t.name, t.id]}.each do |t| roles << t end roles end end
Version data entries
46 entries across 46 versions & 1 rubygems