Sha256: 4a8a078971d2c3afb0b3a698b876d08933a65543858b8103d4692b9d410544f0

Contents?: true

Size: 504 Bytes

Versions: 18

Compression:

Stored size: 504 Bytes

Contents

class User < ActiveRecord::Base
  belongs_to :role
  before_create :add_user_role
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable

  
  def name
    "#{first_name} #{last_name}"
  end

  def role_symbols
      [role.title.to_sym]
  end

  private

  def add_user_role
    self.role = Role.find_by_title 'user'
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
caseadilla-0.0.19 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.18 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.17 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.16 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.15 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.14 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.13 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.12 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.11 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.10 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.9 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.8 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.7 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.6 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.5 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.4 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.3 lib/generators/caseadilla/install/templates/app/models/user.rb
caseadilla-0.0.2 lib/generators/caseadilla/install/templates/app/models/user.rb