edit login

This commit is contained in:
Nweni
2017-06-28 12:57:39 +06:30
parent bce4380d70
commit f01e1b1ce3
3 changed files with 48 additions and 24 deletions

View File

@@ -6,6 +6,10 @@ class Employee < ApplicationRecord
validates :emp_id, uniqueness: true, numericality: true, length: {in: 1..4}, allow_blank: true
validates :password, numericality: true, length: {in: 3..9}, allow_blank: true
def self.all_emp_except_waiter
Employee.where('role!=?','waiter')
end
def self.collection
Employee.select("id, name").map { |e| [e.name, e.id] }
end