tap/app/models/user.rb
2014-11-25 11:30:55 +01:00

13 lines
258 B
Ruby

class User < ActiveRecord::Base
has_many :orders
validates :name, presence: true
validates :last_name, presence: true
validates :nickname, presence: true, uniqueness: true
def full_name
"#{name} #{last_name}"
end
has_secure_password
end