13 lines
258 B
Ruby
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
|