Sha256: c8903d9d46fbfa2bdd3fde0a0b102ba4a10fa2e65ac40830d9f2e26d516803fe
Contents?: true
Size: 601 Bytes
Versions: 62
Compression:
Stored size: 601 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, :dependent => :destroy has_many :users, :through => :permissions validates_presence_of :rolename validates_uniqueness_of :rolename scope :by_alpha, order('roles.rolename ASC') # 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
62 entries across 62 versions & 1 rubygems