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.7 app/models/role.rb
wheels-0.1.6 app/models/role.rb
wheels-0.1.5 app/models/role.rb
wheels-0.1.4 app/models/role.rb
wheels-0.1.3 app/models/role.rb
wheels-0.1.2 app/models/role.rb
wheels-0.1.1 app/models/role.rb
wheels-0.1.0 app/models/role.rb
wheels-0.0.49 app/models/role.rb
wheels-0.0.48 app/models/role.rb
wheels-0.0.47 app/models/role.rb
wheels-0.0.46 app/models/role.rb
wheels-0.0.45 app/models/role.rb
wheels-0.0.44 app/models/role.rb
wheels-0.0.43 app/models/role.rb
wheels-0.0.42 app/models/role.rb
wheels-0.0.41 app/models/role.rb
wheels-0.0.40 app/models/role.rb
wheels-0.0.39 app/models/role.rb
wheels-0.0.38 app/models/role.rb