chore: Generate test data for bulk insertion (#11229)
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com> Co-authored-by: Sojan <sojan@pepalo.com> Co-authored-by: tds-1 <tanmay@qoala.id> Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
committed by
GitHub
parent
cbdbf7900e
commit
6e6912aa56
12
lib/test_data/display_id_tracker.rb
Normal file
12
lib/test_data/display_id_tracker.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class TestData::DisplayIdTracker
|
||||
attr_reader :current
|
||||
|
||||
def initialize(account:)
|
||||
max_display_id = Conversation.where(account_id: account.id).maximum(:display_id) || 0
|
||||
@current = max_display_id
|
||||
end
|
||||
|
||||
def next_id
|
||||
@current += 1
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user