Sha256: a565c0cbad08c59220978ae7e31b21202e69393b115b6435fcaeea751e235aec

Contents?: true

Size: 491 Bytes

Versions: 38

Compression:

Stored size: 491 Bytes

Contents

# == Schema Information
#
# Table name: roles
#
#  id         :integer(4)      not null, primary key
#  rolename   :string(255)
#  created_at :datetime
#  updated_at :datetime
#

class Role < ActiveRecord::Base
  unloadable
  
  has_many :permissions
  has_many :users, :through => :permissions

  validates_presence_of :rolename

  # roles can be defined as symbols.  We want to store them as strings in the database
  def rolename= val
    write_attribute(:rolename, val.to_s)
  end

end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
muck-users-0.2.23 app/models/role.rb
muck-users-0.2.22 app/models/role.rb
muck-users-0.2.21 app/models/role.rb
muck-users-0.2.20 app/models/role.rb
muck-users-0.2.19 app/models/role.rb
muck-users-0.2.18 app/models/role.rb
muck-users-0.2.17 app/models/role.rb
muck-users-0.2.16 app/models/role.rb
muck-users-0.2.15 app/models/role.rb
muck-users-0.2.14 app/models/role.rb
muck-users-0.2.13 app/models/role.rb
muck-users-0.2.12 app/models/role.rb
muck-users-0.2.11 app/models/role.rb
muck-users-0.2.10 app/models/role.rb
muck-users-0.2.9 app/models/role.rb
muck-users-0.2.6 app/models/role.rb
muck-users-0.2.7 app/models/role.rb
muck-users-0.2.8 app/models/role.rb
muck-users-0.1.4 app/models/role.rb
muck-users-0.1.5 app/models/role.rb