Files
fizzy/script/populate/collections_and_cards.rb
T
Mike Dalessio db6b700da8 Clean up the /scripts directory
Not removing anything, just organizing scripts into subdirectories to
make it a bit more readable.
2025-07-21 09:07:15 -04:00

18 lines
578 B
Ruby

require_relative "../../config/environment"
COLLECTIONS_COUNT = 100
CARDS_PER_COLLECTION = 50
ApplicationRecord.current_tenant = "development-tenant"
account = Account.sole
user = account.users.first
Current.session = user.sessions.last
workflow = account.workflows.first
COLLECTIONS_COUNT.times do |collection_index|
collection = Collection.create!(name: "Collection #{collection_index}", creator: user, workflow: workflow)
CARDS_PER_COLLECTION.times do |card_index|
collection.cards.create!(title: "Card #{card_index}", creator: user, status: :published)
end
end