Files
fizzy/script/populate/cards_for_pagination.rb
T
Mike Dalessio 8e13ce5b78 Drop Current.account and just use Account.sole
I had reintroduced this in dacb53b8 after David removed it in
6bbf68a4, but now I agree we don't need it.

Also, fix a CORS error when trying to redirect a user to an untenanted
path after login (see
https://fizzy.37signals.com/5986089/collections/2/cards/1032).
2025-07-20 13:00:09 -04:00

31 lines
707 B
Ruby

require_relative "../../config/environment"
CARDS_COUNT = 200
ApplicationRecord.current_tenant = "37signals"
account = Account.sole
user = User.first
Current.session = user.sessions.last
collection = Collection.first
# Doing
CARDS_COUNT.times do |index|
card = collection.cards.create!(title: "Doing card #{index}", creator: user, status: :published)
card.engage
end
# Considering
CARDS_COUNT.times do |index|
card = collection.cards.create!(title: "Considering card #{index}", creator: user, status: :published)
card.reconsider
end
# Completed
CARDS_COUNT.times do |index|
card = collection.cards.create!(title: "Popped card #{index}", creator: user, status: :published)
card.close
end