Commit 4240cb07 authored by royce-matthew's avatar royce-matthew

added validation

parent 04fad600
class Candidate < ActiveRecord::Base
validates :first_name, presence: true
validates :last_name, presence: true
belongs_to :position
has_many :votes
def full_name
"#{ self.first_name } #{ self.last_name }"
end
......
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_many :votes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment