Class: Role

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/role.rb

Overview

This is the normalized table containing the definitions of roles and an association to which the role is scoped.

Constant Summary collapse

AVAILABLE_ROLES =
[:admin]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atDateTime

Returns the current value of created_at

Returns:

  • (DateTime)

    the current value of created_at


9
10
11
# File 'app/models/role.rb', line 9

def created_at
  @created_at
end

#nameString

Returns the current value of name

Returns:

  • (String)

    the current value of name


9
10
11
# File 'app/models/role.rb', line 9

def name
  @name
end

#resource_idInteger

Returns the current value of resource_id

Returns:

  • (Integer)

    the current value of resource_id


9
10
11
# File 'app/models/role.rb', line 9

def resource_id
  @resource_id
end

#resource_typeString

Returns the current value of resource_type

Returns:

  • (String)

    the current value of resource_type


9
10
11
# File 'app/models/role.rb', line 9

def resource_type
  @resource_type
end

#updated_atDateTime

Returns the current value of updated_at

Returns:

  • (DateTime)

    the current value of updated_at


9
10
11
# File 'app/models/role.rb', line 9

def updated_at
  @updated_at
end

Instance Method Details

#display_nameString

Displays a human readable version of the role name

Returns:

  • (String)

18
19
20
# File 'app/models/role.rb', line 18

def display_name
  @name.capitalize
end