From c10db71cbc4d7e65ff90bd088f642e9d0828905c Mon Sep 17 00:00:00 2001 From: Min Zeya Phyo Date: Tue, 4 Apr 2017 01:22:45 +0630 Subject: [PATCH] lookup and seed data fixes --- app/models/dining_facility.rb | 1 + app/models/table.rb | 2 +- db/migrate/20170403183755_create_tax_profiles.rb | 2 +- db/seeds.rb | 10 ++++++++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/models/dining_facility.rb b/app/models/dining_facility.rb index 513d3f67..dfcc53f1 100644 --- a/app/models/dining_facility.rb +++ b/app/models/dining_facility.rb @@ -1,2 +1,3 @@ class DiningFacility < ApplicationRecord + belongs_to :zone end diff --git a/app/models/table.rb b/app/models/table.rb index 50897d38..31614e12 100644 --- a/app/models/table.rb +++ b/app/models/table.rb @@ -1,4 +1,4 @@ class Table < DiningFacility has_many :dining_ins - + end diff --git a/db/migrate/20170403183755_create_tax_profiles.rb b/db/migrate/20170403183755_create_tax_profiles.rb index 66f7f83a..7f9893d5 100644 --- a/db/migrate/20170403183755_create_tax_profiles.rb +++ b/db/migrate/20170403183755_create_tax_profiles.rb @@ -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 diff --git a/db/seeds.rb b/db/seeds.rb index 5379d9d3..0a8d85c3 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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"})