update seed generator and remove hard-coded customer id

This commit is contained in:
Thein Lin Kyaw
2019-12-20 10:35:31 +06:30
parent 92e467d512
commit d87ffee65b
32 changed files with 184 additions and 153 deletions

View File

@@ -5,10 +5,10 @@ class ApplicationRecord < ActiveRecord::Base
super
return unless subclass.superclass == self
return unless subclass.column_names.include? 'shop_id'
return unless subclass.column_names.include? 'shop_code'
subclass.class_eval do
acts_as_tenant(:shop)
acts_as_tenant(:shop, foreign_key: 'shop_code', primary_key: 'shop_code')
end
end
end