class DiningQueue < ApplicationRecord
    belongs_to :dining_facility, :optional => true
	def self.generate_queue_no
	    today = DateTime.now.strftime('%Y-%m-%d')
        dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? ", today).order("queue_no desc")
		queue_no = dining_queues.count + 1
		return queue_no	
	end
end