23 lines
776 B
Ruby
23 lines
776 B
Ruby
class Lookup < ApplicationRecord
|
|
|
|
def available_types
|
|
{'Employee Roles' => 'employee_roles',
|
|
'Dining Facilities Status' => 'dining_facilities_status',
|
|
'Menu Item Type' => 'menu_item_type',
|
|
'Menu Item Attribute Type' => 'menu_item_attribute_type',
|
|
'Order Type' => 'order_type',
|
|
'Order Source' => 'order_source',
|
|
'Order Status' => 'order_status',
|
|
'Order Item Status' => 'order_item_status',
|
|
'Sale Status' => 'sales_status',
|
|
'Payment Status' => 'payment_status',
|
|
'Payment Methods' => 'payment_methods',
|
|
"Gateway Communication Type" => "gateway_communication_type"}
|
|
end
|
|
|
|
def self.collection_of(type)
|
|
Lookup.select("name, value").where("lookup_type" => type ).map { |l| [l.name, l.value] }
|
|
|
|
end
|
|
end
|