From 76defb5b0bc06f82a2bfe364e8eab68ced8ea245 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Wed, 5 Nov 2025 14:42:03 +0000 Subject: [PATCH] Update seeds from "Collection" to "Board" --- db/seeds.rb | 8 ++++---- db/seeds/37signals.rb | 10 +++++----- db/seeds/honcho.rb | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index bf40aaf0a..76ce2091b 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -51,12 +51,12 @@ def login_as(user) Current.session = user.identity.sessions.create end -def create_collection(name, creator: Current.user, all_access: true, access_to: []) - Collection.create!(name:, creator:, all_access:).tap { it.accesses.grant_to(access_to) } +def create_board(name, creator: Current.user, all_access: true, access_to: []) + Board.create!(name:, creator:, all_access:).tap { it.accesses.grant_to(access_to) } end -def create_card(title, collection:, description: nil, status: :published, creator: Current.user) - collection.cards.create!(title:, description:, creator:, status:) +def create_card(title, board:, description: nil, status: :published, creator: Current.user) + board.cards.create!(title:, description:, creator:, status:) end # Seed accounts diff --git a/db/seeds/37signals.rb b/db/seeds/37signals.rb index cbb5ebeab..3512288dd 100644 --- a/db/seeds/37signals.rb +++ b/db/seeds/37signals.rb @@ -7,17 +7,17 @@ kevin = find_or_create_user "Kevin Mcconnell", "kevin@37signals.com" login_as david -create_collection("Fizzy", access_to: [ jason, jz, kevin ]).tap do |fizzy| - create_card("Prepare sign-up page", description: "We need to do this before the launch.", collection: fizzy) +create_board("Fizzy", access_to: [ jason, jz, kevin ]).tap do |fizzy| + create_card("Prepare sign-up page", description: "We need to do this before the launch.", board: fizzy) - create_card("Prepare sign-up page", description: "We need to do this before the launch.", collection: fizzy).tap do |card| + create_card("Prepare sign-up page", description: "We need to do this before the launch.", board: fizzy).tap do |card| card.toggle_assignment(kevin) - if column = card.collection&.columns&.sample + if column = card.board&.columns&.sample card.triage_into(column) end end - create_card("Plain text mentions", description: "We'll support plain text mentions first.", collection: fizzy).tap do |card| + create_card("Plain text mentions", description: "We'll support plain text mentions first.", board: fizzy).tap do |card| card.toggle_assignment(david) card.close end diff --git a/db/seeds/honcho.rb b/db/seeds/honcho.rb index bba0f378b..ff15bfbee 100644 --- a/db/seeds/honcho.rb +++ b/db/seeds/honcho.rb @@ -24,7 +24,7 @@ card_titles = [ "Set up CI/CD" ] -collections = [ +boards = [ "Project Launch", "Frontend Dev", "Backend Dev", @@ -34,13 +34,13 @@ collections = [ time_range = (60 .. 30.days.in_minutes) -collections.each_with_index do |collection_name, index| - create_collection(collection_name, access_to: authors.sample(3)).tap do |collection| +boards.each_with_index do |board_name, index| + create_board(board_name, access_to: authors.sample(3)).tap do |board| card_titles.each do |title| travel(-rand(time_range).minutes) do card = create_card title, - description: "#{title} for #{collection_name} phase #{index + 1}.", - collection: collection, + description: "#{title} for #{board_name} phase #{index + 1}.", + board: board, creator: authors.sample # Randomly assign to 1-2 authors @@ -56,7 +56,7 @@ collections.each_with_index do |collection_name, index| travel rand(0..20).minutes case rand(3) when 0 - if column = card.collection&.columns&.sample + if column = card.board&.columns&.sample card.triage_into(column) end when 1