update seed

This commit is contained in:
Yan
2017-10-23 14:44:16 +06:30
parent ac42c4a78e
commit 1aa3358013

View File

@@ -2,7 +2,6 @@ class SeedGenerator < ApplicationRecord
# Generate ID for Tables # Generate ID for Tables
def self.generate_id(model, prefix) def self.generate_id(model, prefix)
seed = SeedGenerator.find_by_model(model) seed = SeedGenerator.find_by_model(model)
next_no = seed.next
new_receipt_no = 0 new_receipt_no = 0
if (seed.nil?) if (seed.nil?)
@@ -11,6 +10,7 @@ class SeedGenerator < ApplicationRecord
new_receipt_no = seed.next new_receipt_no = seed.next
seed.save seed.save
else else
next_no = seed.next
# current_no = seed.next # current_no = seed.next
# seed.next = seed.next + seed.increase_by # seed.next = seed.next + seed.increase_by
# seed.current = current_no # seed.current = current_no