merge with settings_backend

This commit is contained in:
Yan
2017-06-18 12:30:06 +06:30
26 changed files with 610 additions and 57 deletions

View File

@@ -6,6 +6,9 @@ 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.collection
Employee.select("id, name").map { |e| [e.name, e.id] }
end
def self.login(emp_id, password)
user = Employee.find_by_emp_id(emp_id)

View File

@@ -5,6 +5,8 @@
class OrderQueueStation < ApplicationRecord
has_many :assigned_order_items
has_many :order_items
has_many :order_queue_process_by_zones
has_many :zones, through: :order_queue_process_by_zones
scope :active, -> {where(is_active: true)}
@@ -22,7 +24,7 @@ class OrderQueueStation < ApplicationRecord
#Loop through the processing items
pq_items.each do |pq_item|
#Processing through the looping items
order_items.each do |order_item|
order_items.each do |order_item|
if (pq_item == order_item.item_code)
if oqs.id == oqpbz.order_queue_station_id
#Same Order_items can appear in two location.

View File

@@ -2,7 +2,12 @@ class Zone < ApplicationRecord
# model association
has_many :tables, dependent: :destroy
has_many :rooms, dependent: :destroy
has_many :order_queue_stations
# validations
validates_presence_of :name, :created_by
def self.collection
Zone.select("id, name").map { |e| [e.name, e.id] }
end
end