fix seed generator length
This commit is contained in:
@@ -17,7 +17,7 @@ class SeedGenerator < ApplicationRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
seed = self.update_seed(model_name)
|
seed = self.update_seed(model_name)
|
||||||
length = 15 - prefix.length
|
length = 16 - prefix.length
|
||||||
prefix + seed.to_s.rjust(length, '0')
|
prefix + seed.to_s.rjust(length, '0')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ class SeedGenerator < ApplicationRecord
|
|||||||
|
|
||||||
start = self.update_seed(model_name, count)
|
start = self.update_seed(model_name, count)
|
||||||
stop = start + count - 1
|
stop = start + count - 1
|
||||||
length = 15 - prefix.length
|
length = 16 - prefix.length
|
||||||
(start..stop).map { |c| prefix + c.to_s.rjust(length, '0') }
|
(start..stop).map { |c| prefix + c.to_s.rjust(length, '0') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user