update seed

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

View File

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