seed generator fun:
This commit is contained in:
@@ -21,7 +21,6 @@ class SeedGenerator < ApplicationRecord
|
||||
seed.model = "sale"
|
||||
new_receipt_no = seed.next
|
||||
seed.save
|
||||
|
||||
else
|
||||
current_no = seed.next
|
||||
seed.next = seed.next
|
||||
@@ -85,7 +84,7 @@ class SeedGenerator < ApplicationRecord
|
||||
current = 0
|
||||
nex = 0
|
||||
|
||||
update_sql = "UPDATE seed_generators set current = current + 1, next = next + 1 WHERE model='#{model}';"
|
||||
update_sql = "UPDATE seed_generators set current = next, next = next + 1 WHERE model='#{model}';"
|
||||
select_sql = "select * from seed_generators where model='#{model}';"
|
||||
update_result = ActiveRecord::Base.connection.execute(update_sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user