lookup and seed data fixes

This commit is contained in:
Min Zeya Phyo
2017-04-04 01:22:45 +06:30
parent 4dc0c762e3
commit c10db71cbc
4 changed files with 11 additions and 4 deletions

View File

@@ -1,2 +1,3 @@
class DiningFacility < ApplicationRecord
belongs_to :zone
end

View File

@@ -1,4 +1,4 @@
class Table < DiningFacility
has_many :dining_ins
end

View File

@@ -5,7 +5,7 @@ class CreateTaxProfiles < ActiveRecord::Migration[5.0]
t.decimal :rate, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.boolean :inclusive, :null => false, :default => false
t.integer :order_by, :null => false, :default => 1
t.string :created_by, :null => false
t.timestamps
end
end

View File

@@ -65,7 +65,13 @@ employee_roles = Lookup.create([{lookup_type:'employee_roles', name: 'Cashier',
customer = Customer.create({id:1, name:"WALK-IN", contact_no:"000000000"})
#Default ZOne
zone = Zone.create({id: 1, name: "Default Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
zone = Zone.create({id:1, name: "Default Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
#Default dining_facilities
dining_facilities = DiningFacilities.create({id:1, zone: zone, status:"available", type: "table", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
dining_facilities = DiningFacility.create({id:1, name:"Default Table", zone: zone, status:"available", type: "Table", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
#Tax Profile
tax_profiles = TaxProfile.create({id:1, name: "Commerical Tax", rate:5.0, order_by:1, created_by:"SYSTEM DEFAULT"})
#Default menu
menu = Menu.create({name: "Default Menu", is_active: true, created_by: "SYSTEM DEFAULT"})