From bf11dba0929d3579bf1875c59fc7ddd28ef4f37c Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 18 Jul 2015 14:49:31 +0200 Subject: [PATCH] adds convenience methods and association [#11] --- app/models/user.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c8220270d..923604dde 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,10 @@ class User < ActiveRecord::Base - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable + has_many :debates + devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable + + def name + "#{first_name} #{last_name}" + end end