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

Version Path
wheels-0.1.30 app/models/role.rb
wheels-0.1.28 app/models/role.rb
wheels-0.1.27 app/models/role.rb
wheels-0.1.25 app/models/role.rb
wheels-0.1.24 app/models/role.rb
wheels-0.1.23 app/models/role.rb
wheels-0.1.22 app/models/role.rb
wheels-0.1.21 app/models/role.rb
wheels-0.1.20 app/models/role.rb
wheels-0.1.19 app/models/role.rb
wheels-0.1.18 app/models/role.rb
wheels-0.1.17 app/models/role.rb
wheels-0.1.16 app/models/role.rb
wheels-0.1.15 app/models/role.rb
wheels-0.1.14 app/models/role.rb
wheels-0.1.13 app/models/role.rb
wheels-0.1.12 app/models/role.rb
wheels-0.1.10 app/models/role.rb
wheels-0.1.9 app/models/role.rb
wheels-0.1.8 app/models/role.rb