From e726335833db3f89e0241a2540d2dc24cd471ba3 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sun, 2 Nov 2025 00:05:38 +0100 Subject: [PATCH 01/21] WIP for seeding accounts --- Gemfile.lock | 2 +- app/models/account.rb | 4 ++ app/models/account/seeder.rb | 77 ++++++++++++++++++++++++++++ gems/fizzy-saas/app/models/signup.rb | 2 +- lib/tasks/seed.rake | 13 +++++ 5 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 app/models/account/seeder.rb create mode 100644 lib/tasks/seed.rake diff --git a/Gemfile.lock b/Gemfile.lock index eb6ae5aa8..3c76704a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -296,7 +296,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.1.13.beta) + lexxy (0.1.14.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) diff --git a/app/models/account.rb b/app/models/account.rb index 357d0cc29..edd75655c 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -31,6 +31,10 @@ class Account < ApplicationRecord Collection.create!(name: "Cards", creator: user, all_access: true) end + def setup_customer_template + Account::Seeder.new(self, User.first).seed + end + private def create_join_code Account::JoinCode.create! diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb new file mode 100644 index 000000000..f2d01919e --- /dev/null +++ b/app/models/account/seeder.rb @@ -0,0 +1,77 @@ +class Account::Seeder + attr_reader :account, :creator + + def initialize(account, creator) + @account = account + @creator = creator + + puts creator.inspect + end + + def seed + Current.set session: session do + populate + end + end + + def seed! + raise "You can't run in production environments" unless Rails.env.local? + + delete_everything + seed + end + + private + def session + creator.identity.sessions.last + end + + def populate + # --------------- + # Bugs Collection + # --------------- + bug_tracker = Collection.create!(name: "Bugs", creator: creator, all_access: true) + + # Columns + triage_column = bug_tracker.columns.create!(name: "Triage", color: "#ef4444") + in_progress_column = bug_tracker.columns.create!(name: "In Progress", color: "#f97316") + resolved_column = bug_tracker.columns.create!(name: "Resolved", color: "#22c55e") + + # Cards + bug_tracker.cards.create!(creator: creator, column: triage_column, title: "Login button not responding on mobile", status: "published") + bug_tracker.cards.create!(creator: creator, column: triage_column, title: "Search results showing duplicates", status: "published") + profile_crash_card = bug_tracker.cards.create!(creator: creator, column: in_progress_column, title: "Profile page crashes when uploading large images", status: "published") + bug_tracker.cards.create!(creator: creator, column: in_progress_column, title: "Email notifications not being sent", status: "published") + bug_tracker.cards.create!(creator: creator, column: resolved_column, title: "Fix broken links in footer", status: "published") + + # Comments + profile_crash_card.comments.create!(creator: creator, body: "I can reproduce this with images over 5MB") + profile_crash_card.comments.create!(creator: creator, body: "Looking into adding client-side image compression before upload") + + # ---------------------------- + # Feature Requests Collection + # ---------------------------- + feature_requests = Collection.create!(name: "Feature Requests", creator: creator, all_access: true) + + # Columns + backlog_column = feature_requests.columns.create!(name: "Backlog", color: "#6366f1") + planning_column = feature_requests.columns.create!(name: "Planning", color: "#8b5cf6") + + # Cards + feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Add dark mode support", status: "published") + feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Export data to CSV", status: "published") + feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Add keyboard shortcuts for navigation", status: "published") + two_factor_card = feature_requests.cards.create!(creator: creator, column: planning_column, title: "Implement two-factor authentication", status: "published") + feature_requests.cards.create!(creator: creator, column: planning_column, title: "Add bulk actions for managing items", status: "published") + + # Comments + two_factor_card.comments.create!(creator: creator, body: "Should we support SMS and authenticator apps?") + two_factor_card.comments.create!(creator: creator, body: "Let's start with authenticator apps only to keep it simple") + end + + def delete_everything + Current.set session: session do + Collection.destroy_all + end + end +end diff --git a/gems/fizzy-saas/app/models/signup.rb b/gems/fizzy-saas/app/models/signup.rb index 58ee5775a..ed9b94528 100644 --- a/gems/fizzy-saas/app/models/signup.rb +++ b/gems/fizzy-saas/app/models/signup.rb @@ -116,7 +116,7 @@ class Signup } ) @user = User.find_by!(role: :admin) - @account.setup_basic_template + @account.setup_customer_template end end diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake new file mode 100644 index 000000000..97f28f233 --- /dev/null +++ b/lib/tasks/seed.rake @@ -0,0 +1,13 @@ +namespace :seed do + desc "Seed customer data for a specific account (e.g., rails seed:customer 1234)" + task :customer, [:tenant_id] => :environment do |t, args| + raise "Please provide a tenant ID: rails seed:customer[1234]" unless args[:tenant_id] + + tenant_id = args[:tenant_id].to_i + ApplicationRecord.current_tenant = tenant_id + account = Account.sole + Account::Seeder.new(account, User.first).seed! + + puts "✓ Seeded account #{account.name} (tenant: #{tenant_id})" + end +end From ac507aa754f80ad77b4c4f4f32b0516e33273e56 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sun, 2 Nov 2025 09:24:38 +0100 Subject: [PATCH 02/21] Add support for remote images in the seeding system --- app/models/account/seeder.rb | 70 +++++++++++++------ app/models/concerns/attachments.rb | 8 +++ .../attachables/_remote_image.html.erb | 8 +++ app/views/events/event/_attachments.html.erb | 6 +- lib/tasks/seed.rake | 2 +- 5 files changed, 71 insertions(+), 23 deletions(-) create mode 100644 app/views/action_text/attachables/_remote_image.html.erb diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index f2d01919e..989b56852 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -30,43 +30,71 @@ class Account::Seeder # --------------- # Bugs Collection # --------------- - bug_tracker = Collection.create!(name: "Bugs", creator: creator, all_access: true) + bug_tracker = Collection.create! name: "Bugs", creator: creator, all_access: true # Columns - triage_column = bug_tracker.columns.create!(name: "Triage", color: "#ef4444") - in_progress_column = bug_tracker.columns.create!(name: "In Progress", color: "#f97316") - resolved_column = bug_tracker.columns.create!(name: "Resolved", color: "#22c55e") + triage_column = bug_tracker.columns.create! name: "Triage", color: "#ef4444" + in_progress_column = bug_tracker.columns.create! name: "In Progress", color: "#f97316" + resolved_column = bug_tracker.columns.create! name: "Resolved", color: "#22c55e" # Cards - bug_tracker.cards.create!(creator: creator, column: triage_column, title: "Login button not responding on mobile", status: "published") - bug_tracker.cards.create!(creator: creator, column: triage_column, title: "Search results showing duplicates", status: "published") - profile_crash_card = bug_tracker.cards.create!(creator: creator, column: in_progress_column, title: "Profile page crashes when uploading large images", status: "published") - bug_tracker.cards.create!(creator: creator, column: in_progress_column, title: "Email notifications not being sent", status: "published") - bug_tracker.cards.create!(creator: creator, column: resolved_column, title: "Fix broken links in footer", status: "published") + bug_tracker.cards.create! creator: creator, column: triage_column, title: "Login button not responding on mobile", status: "published", description: <<~HTML +

Users are reporting that the login button is not responding on mobile devices.

+ +

Steps to reproduce:

+ + +

This appears to be affecting iOS devices primarily.

+ + + HTML + bug_tracker.cards.create! creator: creator, column: triage_column, title: "Search results showing duplicates", status: "published" + profile_crash_card = bug_tracker.cards.create! creator: creator, column: in_progress_column, title: "Profile page crashes when uploading large images", status: "published" + bug_tracker.cards.create! creator: creator, column: in_progress_column, title: "Email notifications not being sent", status: "published" + bug_tracker.cards.create! creator: creator, column: resolved_column, title: "Fix broken links in footer", status: "published" # Comments - profile_crash_card.comments.create!(creator: creator, body: "I can reproduce this with images over 5MB") - profile_crash_card.comments.create!(creator: creator, body: "Looking into adding client-side image compression before upload") + profile_crash_card.comments.create! creator: creator, body: "I can reproduce this with images over 5MB" + profile_crash_card.comments.create! creator: creator, body: "Looking into adding client-side image compression before upload" # ---------------------------- # Feature Requests Collection # ---------------------------- - feature_requests = Collection.create!(name: "Feature Requests", creator: creator, all_access: true) + feature_requests = Collection.create! name: "Feature Requests", creator: creator, all_access: true # Columns - backlog_column = feature_requests.columns.create!(name: "Backlog", color: "#6366f1") - planning_column = feature_requests.columns.create!(name: "Planning", color: "#8b5cf6") + backlog_column = feature_requests.columns.create! name: "Backlog", color: "#6366f1" + planning_column = feature_requests.columns.create! name: "Planning", color: "#8b5cf6" # Cards - feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Add dark mode support", status: "published") - feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Export data to CSV", status: "published") - feature_requests.cards.create!(creator: creator, column: backlog_column, title: "Add keyboard shortcuts for navigation", status: "published") - two_factor_card = feature_requests.cards.create!(creator: creator, column: planning_column, title: "Implement two-factor authentication", status: "published") - feature_requests.cards.create!(creator: creator, column: planning_column, title: "Add bulk actions for managing items", status: "published") + feature_requests.cards.create! creator: creator, column: backlog_column, title: "Add dark mode support", status: "published", description: <<~HTML +

Many users have requested a dark mode option for better usability in low-light environments.

+ +

Proposed features:

+
    +
  • Toggle in user settings
  • +
  • Respect system preferences automatically
  • +
  • Smooth transition between themes
  • +
  • Persistent theme selection across sessions
  • +
+ +

This would improve accessibility and reduce eye strain for our users.

+ + + HTML + feature_requests.cards.create! creator: creator, column: backlog_column, title: "Export data to CSV", status: "published" + feature_requests.cards.create! creator: creator, column: backlog_column, title: "Add keyboard shortcuts for navigation", status: "published" + two_factor_card = feature_requests.cards.create! creator: creator, column: planning_column, title: "Implement two-factor authentication", status: "published" + feature_requests.cards.create! creator: creator, column: planning_column, title: "Add bulk actions for managing items", status: "published" # Comments - two_factor_card.comments.create!(creator: creator, body: "Should we support SMS and authenticator apps?") - two_factor_card.comments.create!(creator: creator, body: "Let's start with authenticator apps only to keep it simple") + two_factor_card.comments.create! creator: creator, body: "Should we support SMS and authenticator apps?" + two_factor_card.comments.create! creator: creator, body: "Let's start with authenticator apps only to keep it simple" end def delete_everything diff --git a/app/models/concerns/attachments.rb b/app/models/concerns/attachments.rb index f4328600e..1813e61e9 100644 --- a/app/models/concerns/attachments.rb +++ b/app/models/concerns/attachments.rb @@ -28,6 +28,14 @@ module Attachments attachments.any? end + def remote_images + rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteImage) || [] + end + + def has_remote_images? + remote_images.any? + end + private def rich_text_record @rich_text_record ||= begin diff --git a/app/views/action_text/attachables/_remote_image.html.erb b/app/views/action_text/attachables/_remote_image.html.erb new file mode 100644 index 000000000..174a95c5e --- /dev/null +++ b/app/views/action_text/attachables/_remote_image.html.erb @@ -0,0 +1,8 @@ +
+ <%= image_tag remote_image.url, width: remote_image.width, height: remote_image.height %> + <% if caption = remote_image.try(:caption) %> +
+ <%= caption %> +
+ <% end %> +
diff --git a/app/views/events/event/_attachments.html.erb b/app/views/events/event/_attachments.html.erb index 9a255e8cb..05b88e6ba 100644 --- a/app/views/events/event/_attachments.html.erb +++ b/app/views/events/event/_attachments.html.erb @@ -1,4 +1,4 @@ -<% if eventable&.has_attachments? %> +<% if eventable&.has_attachments? || eventable&.has_remote_images? %> <% eventable.attachments.each do |attachment| %> <% variant = Attachments::VARIANTS[:small] %> @@ -15,5 +15,9 @@ <% end %> <% end %> + + <% eventable.remote_images.each do |remote_image| %> + <%= image_tag remote_image.url, class: "attachment attachment--image", width: remote_image.width, height: remote_image.height, alt: remote_image.alt %> + <% end %> <% end %> diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake index 97f28f233..31fada3a6 100644 --- a/lib/tasks/seed.rake +++ b/lib/tasks/seed.rake @@ -6,7 +6,7 @@ namespace :seed do tenant_id = args[:tenant_id].to_i ApplicationRecord.current_tenant = tenant_id account = Account.sole - Account::Seeder.new(account, User.first).seed! + Account::Seeder.new(account, User.active.first).seed! puts "✓ Seeded account #{account.name} (tenant: #{tenant_id})" end From 2ec5d3794780a22a9ac103c1753ad915ab76d302 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sun, 2 Nov 2025 09:38:48 +0100 Subject: [PATCH 03/21] Add support for remote videos too --- app/models/account/seeder.rb | 6 +++++- app/models/concerns/attachments.rb | 8 ++++++++ .../action_text/attachables/_remote_video.html.erb | 10 ++++++++++ app/views/events/event/_attachments.html.erb | 10 ++++++++-- 4 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 app/views/action_text/attachables/_remote_video.html.erb diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index 989b56852..f9f06cb98 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -59,7 +59,11 @@ class Account::Seeder bug_tracker.cards.create! creator: creator, column: resolved_column, title: "Fix broken links in footer", status: "published" # Comments - profile_crash_card.comments.create! creator: creator, body: "I can reproduce this with images over 5MB" + profile_crash_card.comments.create! creator: creator, body: <<~HTML + I can reproduce this with images over 5MB + + + HTML profile_crash_card.comments.create! creator: creator, body: "Looking into adding client-side image compression before upload" # ---------------------------- diff --git a/app/models/concerns/attachments.rb b/app/models/concerns/attachments.rb index 1813e61e9..d30496165 100644 --- a/app/models/concerns/attachments.rb +++ b/app/models/concerns/attachments.rb @@ -36,6 +36,14 @@ module Attachments remote_images.any? end + def remote_videos + rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteVideo) || [] + end + + def has_remote_videos? + remote_videos.any? + end + private def rich_text_record @rich_text_record ||= begin diff --git a/app/views/action_text/attachables/_remote_video.html.erb b/app/views/action_text/attachables/_remote_video.html.erb new file mode 100644 index 000000000..5233d062a --- /dev/null +++ b/app/views/action_text/attachables/_remote_video.html.erb @@ -0,0 +1,10 @@ +
+ <%= tag.video controls: true, width: remote_video.width, height: remote_video.height do %> + <%= tag.source src: remote_video.url, type: remote_video.content_type %> + <% end %> + <% if caption = remote_video.try(:caption) %> +
+ <%= caption %> +
+ <% end %> +
diff --git a/app/views/events/event/_attachments.html.erb b/app/views/events/event/_attachments.html.erb index 05b88e6ba..aff8316da 100644 --- a/app/views/events/event/_attachments.html.erb +++ b/app/views/events/event/_attachments.html.erb @@ -1,4 +1,4 @@ -<% if eventable&.has_attachments? || eventable&.has_remote_images? %> +<% if eventable&.has_attachments? || eventable&.has_remote_images? || eventable&.has_remote_videos? %> <% eventable.attachments.each do |attachment| %> <% variant = Attachments::VARIANTS[:small] %> @@ -17,7 +17,13 @@ <% end %> <% eventable.remote_images.each do |remote_image| %> - <%= image_tag remote_image.url, class: "attachment attachment--image", width: remote_image.width, height: remote_image.height, alt: remote_image.alt %> + <%= image_tag remote_image.url, class: "attachment attachment--image", width: remote_image.width, height: remote_image.height %> + <% end %> + + <% eventable.remote_videos.each do |remote_video| %> + <%= tag.video controls: true, class: "attachment attachment--video", width: remote_video.width, height: remote_video.height do %> + <%= tag.source src: remote_video.url, type: remote_video.content_type %> + <% end %> <% end %> <% end %> From 4e2f56f4c0b553c88a493a05c0f141cd3ac352d0 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sun, 2 Nov 2025 09:44:50 +0100 Subject: [PATCH 04/21] Extract concern, add tests --- app/models/account.rb | 12 +----------- app/models/account/seedeable.rb | 13 +++++++++++++ app/models/account/seeder.rb | 2 -- test/models/account/seedeable_test.rb | 23 +++++++++++++++++++++++ 4 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 app/models/account/seedeable.rb create mode 100644 test/models/account/seedeable_test.rb diff --git a/app/models/account.rb b/app/models/account.rb index edd75655c..e32f0bcdb 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,5 +1,5 @@ class Account < ApplicationRecord - include Entropic + include Entropic, Seedeable has_many_attached :uploads @@ -25,16 +25,6 @@ class Account < ApplicationRecord "/#{tenant}" end - def setup_basic_template - user = User.first - - Collection.create!(name: "Cards", creator: user, all_access: true) - end - - def setup_customer_template - Account::Seeder.new(self, User.first).seed - end - private def create_join_code Account::JoinCode.create! diff --git a/app/models/account/seedeable.rb b/app/models/account/seedeable.rb new file mode 100644 index 000000000..a4096c28e --- /dev/null +++ b/app/models/account/seedeable.rb @@ -0,0 +1,13 @@ +module Account::Seedeable + extend ActiveSupport::Concern + + def setup_basic_template + user = User.first + + Collection.create!(name: "Cards", creator: user, all_access: true) + end + + def setup_customer_template + Account::Seeder.new(self, User.active.first).seed + end +end diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index f9f06cb98..28e977c29 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -4,8 +4,6 @@ class Account::Seeder def initialize(account, creator) @account = account @creator = creator - - puts creator.inspect end def seed diff --git a/test/models/account/seedeable_test.rb b/test/models/account/seedeable_test.rb new file mode 100644 index 000000000..432482876 --- /dev/null +++ b/test/models/account/seedeable_test.rb @@ -0,0 +1,23 @@ +require "test_helper" + +class Account::SedeableTest < ActiveSupport::TestCase + setup do + @account = Account.sole + end + + test "setup_basic_template changes collection count" do + assert_changes -> { Collection.count } do + @account.setup_basic_template + end + end + + test "setup_customer_template changes collections, cards, and comments count" do + assert_changes -> { Collection.count } do + assert_changes -> { Card.count } do + assert_changes -> { Comment.count } do + @account.setup_customer_template + end + end + end + end +end From 348e3a890b6664f00945f3e1a3498e6b1d8aee29 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Sun, 2 Nov 2025 09:45:11 +0100 Subject: [PATCH 05/21] Fix test --- gems/fizzy-saas/test/models/signup_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gems/fizzy-saas/test/models/signup_test.rb b/gems/fizzy-saas/test/models/signup_test.rb index 44d801017..685b25b38 100644 --- a/gems/fizzy-saas/test/models/signup_test.rb +++ b/gems/fizzy-saas/test/models/signup_test.rb @@ -54,7 +54,7 @@ class SignupTest < ActiveSupport::TestCase end test "#complete" do - Account.any_instance.expects(:setup_basic_template).once + Account.any_instance.expects(:setup_customer_template).once # First create the membership signup_for_membership = Signup.new( From 733bb4e6d7e4766a02534ae007f0e7f08171e51b Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Mon, 3 Nov 2025 07:25:48 +0100 Subject: [PATCH 06/21] Rename tests --- test/models/account/seedeable_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/models/account/seedeable_test.rb b/test/models/account/seedeable_test.rb index 432482876..010df5661 100644 --- a/test/models/account/seedeable_test.rb +++ b/test/models/account/seedeable_test.rb @@ -5,13 +5,13 @@ class Account::SedeableTest < ActiveSupport::TestCase @account = Account.sole end - test "setup_basic_template changes collection count" do + test "setup_basic_template adds collections" do assert_changes -> { Collection.count } do @account.setup_basic_template end end - test "setup_customer_template changes collections, cards, and comments count" do + test "setup_customer_template adds collections, cards, and comments" do assert_changes -> { Collection.count } do assert_changes -> { Card.count } do assert_changes -> { Comment.count } do From bc915c4b05ba334117c4d59408874f5dad0b0c72 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Mon, 3 Nov 2025 07:29:00 +0100 Subject: [PATCH 07/21] Extract partials --- app/views/events/event/_attachments.html.erb | 28 ++----------------- .../event/attachments/_attachment.html.erb | 13 +++++++++ .../event/attachments/_remote_image.html.erb | 1 + .../event/attachments/_remote_video.html.erb | 3 ++ 4 files changed, 20 insertions(+), 25 deletions(-) create mode 100644 app/views/events/event/attachments/_attachment.html.erb create mode 100644 app/views/events/event/attachments/_remote_image.html.erb create mode 100644 app/views/events/event/attachments/_remote_video.html.erb diff --git a/app/views/events/event/_attachments.html.erb b/app/views/events/event/_attachments.html.erb index aff8316da..faaf73f5a 100644 --- a/app/views/events/event/_attachments.html.erb +++ b/app/views/events/event/_attachments.html.erb @@ -1,29 +1,7 @@ <% if eventable&.has_attachments? || eventable&.has_remote_images? || eventable&.has_remote_videos? %> - <% eventable.attachments.each do |attachment| %> - <% variant = Attachments::VARIANTS[:small] %> - <% width = attachment.metadata["width"] %> - <% height = attachment.metadata["height"] %> - - <% if attachment.previewable? %> - <%= image_tag url_for(attachment.preview(variant)), class: "attachment attachment--image", width: width, height: height %> - <% elsif attachment.variable? %> - <%= image_tag url_for(attachment.variant(variant)), class: "attachment attachment--image", width: width, height: height %> - <% else %> -
- <%= attachment.filename.extension&.downcase.presence || "unknown" %> -
- <% end %> - <% end %> - - <% eventable.remote_images.each do |remote_image| %> - <%= image_tag remote_image.url, class: "attachment attachment--image", width: remote_image.width, height: remote_image.height %> - <% end %> - - <% eventable.remote_videos.each do |remote_video| %> - <%= tag.video controls: true, class: "attachment attachment--video", width: remote_video.width, height: remote_video.height do %> - <%= tag.source src: remote_video.url, type: remote_video.content_type %> - <% end %> - <% end %> + <%= render partial: "events/event/attachments/attachment", collection: eventable.attachments %> + <%= render partial: "events/event/attachments/remote_image", collection: eventable.remote_images %> + <%= render partial: "events/event/attachments/remote_video", collection: eventable.remote_videos %>
<% end %> diff --git a/app/views/events/event/attachments/_attachment.html.erb b/app/views/events/event/attachments/_attachment.html.erb new file mode 100644 index 000000000..c1eb254d0 --- /dev/null +++ b/app/views/events/event/attachments/_attachment.html.erb @@ -0,0 +1,13 @@ +<% variant = Attachments::VARIANTS[:small] %> +<% width = attachment.metadata["width"] %> +<% height = attachment.metadata["height"] %> + +<% if attachment.previewable? %> + <%= image_tag url_for(attachment.preview(variant)), class: "attachment attachment--image", width: width, height: height %> +<% elsif attachment.variable? %> + <%= image_tag url_for(attachment.variant(variant)), class: "attachment attachment--image", width: width, height: height %> +<% else %> +
+ <%= attachment.filename.extension&.downcase.presence || "unknown" %> +
+<% end %> diff --git a/app/views/events/event/attachments/_remote_image.html.erb b/app/views/events/event/attachments/_remote_image.html.erb new file mode 100644 index 000000000..baec7f632 --- /dev/null +++ b/app/views/events/event/attachments/_remote_image.html.erb @@ -0,0 +1 @@ +<%= image_tag remote_image.url, class: "attachment attachment--image", width: remote_image.width, height: remote_image.height %> diff --git a/app/views/events/event/attachments/_remote_video.html.erb b/app/views/events/event/attachments/_remote_video.html.erb new file mode 100644 index 000000000..78199e296 --- /dev/null +++ b/app/views/events/event/attachments/_remote_video.html.erb @@ -0,0 +1,3 @@ +<%= tag.video controls: true, class: "attachment attachment--video", width: remote_video.width, height: remote_video.height do %> + <%= tag.source src: remote_video.url, type: remote_video.content_type %> +<% end %> From 825184ab1b062797997d898ecef21df5eef7d3fb Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Mon, 3 Nov 2025 07:30:23 +0100 Subject: [PATCH 08/21] Memoize since these are invoked several times --- app/models/concerns/attachments.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/concerns/attachments.rb b/app/models/concerns/attachments.rb index d30496165..1d1c2c4d6 100644 --- a/app/models/concerns/attachments.rb +++ b/app/models/concerns/attachments.rb @@ -29,7 +29,7 @@ module Attachments end def remote_images - rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteImage) || [] + @remote_images ||= rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteImage) || [] end def has_remote_images? @@ -37,7 +37,7 @@ module Attachments end def remote_videos - rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteVideo) || [] + @remote_videos ||= rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteVideo) || [] end def has_remote_videos? From 4e999eaf86d12f8fe509d3fdeef819c6a983e66a Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Mon, 3 Nov 2025 15:04:06 +0100 Subject: [PATCH 09/21] Use existing ARTENANT env var for selecting the tenant Thanks Mike for the tip! --- lib/tasks/seed.rake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake index 31fada3a6..4c7dd3937 100644 --- a/lib/tasks/seed.rake +++ b/lib/tasks/seed.rake @@ -1,13 +1,11 @@ namespace :seed do - desc "Seed customer data for a specific account (e.g., rails seed:customer 1234)" - task :customer, [:tenant_id] => :environment do |t, args| - raise "Please provide a tenant ID: rails seed:customer[1234]" unless args[:tenant_id] + desc "Seed customer data for a specific account (e.g: rails seed:customer ARTENANT=1234)" + task :customer, [:tenant_id] => "db:tenant" do |t, args| + raise "Please provide a tenant ID: rails seed:customer ARTENANT=1234" unless ApplicationRecord.current_tenant - tenant_id = args[:tenant_id].to_i - ApplicationRecord.current_tenant = tenant_id account = Account.sole Account::Seeder.new(account, User.active.first).seed! - puts "✓ Seeded account #{account.name} (tenant: #{tenant_id})" + puts "✓ Seeded account #{account.name} (tenant: #{account.id})" end end From 030ff2b11c4a856e30657f9af5c0d920c7860455 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 12:10:07 -0600 Subject: [PATCH 10/21] Stands in for `` while editing --- app/assets/stylesheets/rich-text-content.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/rich-text-content.css b/app/assets/stylesheets/rich-text-content.css index 9832dbc93..4046157e7 100644 --- a/app/assets/stylesheets/rich-text-content.css +++ b/app/assets/stylesheets/rich-text-content.css @@ -61,6 +61,10 @@ display: none; } + .lexxy-content__strikethrough { + text-decoration: line-through; + } + /* Code */ :where(code, pre) { background-color: var(--color-canvas); From 5cac52fd721e595e4be1788c9f7bf2fec5eb1feb Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 12:16:03 -0600 Subject: [PATCH 11/21] Space between undo/redo and the rest of the toolbar buttons --- app/assets/stylesheets/lexxy.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/assets/stylesheets/lexxy.css b/app/assets/stylesheets/lexxy.css index 5d0f37dc3..e3f8f8cbd 100644 --- a/app/assets/stylesheets/lexxy.css +++ b/app/assets/stylesheets/lexxy.css @@ -163,6 +163,10 @@ z-index: 1; } + :where(.lexxy-editor__toolbar-spacer) { + flex: 1; + } + /* Based on .input, .input--select */ .lexxy-code-language-picker { -webkit-appearance: none; From 9cd8d2fbf4e8b3304141b052ea4e10813d07f078 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 12:40:16 -0600 Subject: [PATCH 12/21] Style dividers --- app/assets/stylesheets/rich-text-content.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/stylesheets/rich-text-content.css b/app/assets/stylesheets/rich-text-content.css index 4046157e7..72cba909b 100644 --- a/app/assets/stylesheets/rich-text-content.css +++ b/app/assets/stylesheets/rich-text-content.css @@ -61,6 +61,17 @@ display: none; } + :where(hr) { + block-size: 0; + border-block-end: 1px solid currentColor; + inline-size: 20%; + margin: var(--block-margin) 0; + } + + .horizontal-divider { + margin-inline: 0; + } + .lexxy-content__strikethrough { text-decoration: line-through; } From 9ca4d17a03db438386931c366b4a1b6f37ddb136 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 12:53:01 -0600 Subject: [PATCH 13/21] We won't need this now that we have a playground account --- app/assets/stylesheets/events.css | 11 ----------- app/views/events/index.html.erb | 10 ---------- app/views/my/menus/_places.html.erb | 1 - 3 files changed, 22 deletions(-) diff --git a/app/assets/stylesheets/events.css b/app/assets/stylesheets/events.css index 660fda3bd..42d129125 100644 --- a/app/assets/stylesheets/events.css +++ b/app/assets/stylesheets/events.css @@ -225,17 +225,6 @@ text-align: center; } - .events__welcome-video { - .events:has(.day-timeline-pagination-link) + & { - display: none !important; - } - - iframe { - aspect-ratio: 16 / 9; - inline-size: 100%; - } - } - /* Event /* ------------------------------------------------------------------------ */ diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index 4bdc6b8c7..ca071f189 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -23,13 +23,3 @@ <%= day_timeline_pagination_link(@day_timeline, @filter) %> <% end %> <% end %> - -
- -
diff --git a/app/views/my/menus/_places.html.erb b/app/views/my/menus/_places.html.erb index 8b7be5b73..53802ce7d 100644 --- a/app/views/my/menus/_places.html.erb +++ b/app/views/my/menus/_places.html.erb @@ -1,5 +1,4 @@ <%= collapsible_nav_section "Jump to…" do %> - <%= filter_place_menu_item "https://www.youtube.com/watch?v=rNKRdk7DLHM", "BOXCAR beta orientation", "youtube", new_window: true %> <%= filter_place_menu_item account_settings_path, "Account Settings", "settings" %> <%= filter_place_menu_item user_path(Current.user), "My Profile", "person" %> <%= filter_place_menu_item notifications_path, "Notifications", "bell" %> From 75e27c3e24344b5f8dda1ccbf09a2cf217b6959e Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 14:18:12 -0600 Subject: [PATCH 14/21] First pass a seeds based on JF's playground project Videos TBD --- app/models/account/seeder.rb | 104 ++++++++++++++--------------------- 1 file changed, 42 insertions(+), 62 deletions(-) diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index 28e977c29..7480ca88f 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -26,77 +26,57 @@ class Account::Seeder def populate # --------------- - # Bugs Collection + # Playground Collection # --------------- - bug_tracker = Collection.create! name: "Bugs", creator: creator, all_access: true - - # Columns - triage_column = bug_tracker.columns.create! name: "Triage", color: "#ef4444" - in_progress_column = bug_tracker.columns.create! name: "In Progress", color: "#f97316" - resolved_column = bug_tracker.columns.create! name: "Resolved", color: "#22c55e" + playground = Collection.create! name: "Playground", creator: creator, all_access: true # Cards - bug_tracker.cards.create! creator: creator, column: triage_column, title: "Login button not responding on mobile", status: "published", description: <<~HTML -

Users are reporting that the login button is not responding on mobile devices.

- -

Steps to reproduce:

-
    -
  • Open the app on mobile browser
  • -
  • Navigate to login page
  • -
  • Tap the login button
  • -
  • Nothing happens
  • -
- -

This appears to be affecting iOS devices primarily.

- - + have_fun_card = playground.cards.create! creator: creator, title: "Have fun!", status: "published", description: <<~HTML +

Mess around, make more boards, add more cards, and get your work, issues, or ideas organized! Include a video of the full product walkthrough.

HTML - bug_tracker.cards.create! creator: creator, column: triage_column, title: "Search results showing duplicates", status: "published" - profile_crash_card = bug_tracker.cards.create! creator: creator, column: in_progress_column, title: "Profile page crashes when uploading large images", status: "published" - bug_tracker.cards.create! creator: creator, column: in_progress_column, title: "Email notifications not being sent", status: "published" - bug_tracker.cards.create! creator: creator, column: resolved_column, title: "Fix broken links in footer", status: "published" - # Comments - profile_crash_card.comments.create! creator: creator, body: <<~HTML - I can reproduce this with images over 5MB - - + playground.cards.create! creator: creator, title: "Head back home to check out activity", status: "published", description: <<~HTML +

Hit “1” or pull down the BOXCAR menu and select “Home”.

HTML - profile_crash_card.comments.create! creator: creator, body: "Looking into adding client-side image compression before upload" - # ---------------------------- - # Feature Requests Collection - # ---------------------------- - feature_requests = Collection.create! name: "Feature Requests", creator: creator, all_access: true - - # Columns - backlog_column = feature_requests.columns.create! name: "Backlog", color: "#6366f1" - planning_column = feature_requests.columns.create! name: "Planning", color: "#8b5cf6" - - # Cards - feature_requests.cards.create! creator: creator, column: backlog_column, title: "Add dark mode support", status: "published", description: <<~HTML -

Many users have requested a dark mode option for better usability in low-light environments.

- -

Proposed features:

-
    -
  • Toggle in user settings
  • -
  • Respect system preferences automatically
  • -
  • Smooth transition between themes
  • -
  • Persistent theme selection across sessions
  • -
- -

This would improve accessibility and reduce eye strain for our users.

- - + playground.cards.create! creator: creator, title: "Check out all cards assigned to you", status: "published", description: <<~HTML +

Pull down the Fizzy menu at the top of the screen, and select “Assigned to me” or just type “3” any time.

HTML - feature_requests.cards.create! creator: creator, column: backlog_column, title: "Export data to CSV", status: "published" - feature_requests.cards.create! creator: creator, column: backlog_column, title: "Add keyboard shortcuts for navigation", status: "published" - two_factor_card = feature_requests.cards.create! creator: creator, column: planning_column, title: "Implement two-factor authentication", status: "published" - feature_requests.cards.create! creator: creator, column: planning_column, title: "Add bulk actions for managing items", status: "published" - # Comments - two_factor_card.comments.create! creator: creator, body: "Should we support SMS and authenticator apps?" - two_factor_card.comments.create! creator: creator, body: "Let's start with authenticator apps only to keep it simple" + playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML +

Pull down the Fizzy menu at the top of the screen, select “Account” or just hit 6, then grab the invite link over on the left side. You can give this link to someone else so they can make an login for themselves in your account.

+ HTML + + playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML +

Pull down the Fizzy menu at the top of the screen, select “Account” or just hit 6, then grab the invite link over on the left side. You can give this link to someone else so they can make an login for themselves in your account.

+ HTML + + playground.cards.create! creator: creator, title: "Assign this card to yourself", status: "published", description: <<~HTML +

Click the little head with the + next to it, pick yourself.

+ HTML + + playground.cards.create! creator: creator, title: "Tag this card “Design” the move it to YES", status: "published", description: <<~HTML +

Click the little Tag icon, type Design, then save. Then, move the card to the new “YES” column you created in the previous step.

+ HTML + + playground.cards.create! creator: creator, title: "Make two more columns", status: "published", description: <<~HTML +
    +
  1. Make one called "Yes"
  2. +
  3. Make another called "Working on"
  4. +
+


+

Go back to the Board view, click the little “+” to the right of the DONE column, name the column, pick a color, then do it again.

+


+

After that, drag this card to “DONE” or select “DONE” in the sidebar.

+ HTML + + playground.cards.create! creator: creator, title: "Move this card to NOT NOW", status: "published", description: <<~HTML +

You can either select “NOT NOW” over in the sidebar, or you can go back out to the Board view and drag this card into the NOT NOW column on the left side.

+ HTML + + playground.cards.create! creator: creator, title: "Rename this card", status: "published", description: <<~HTML +

Click the title and you can rename the card, change the description, or add more information to the card.

+ HTML end def delete_everything From 2df8e159ae1b389642fb2afdc43c3e6fa9bdd497 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 14:18:24 -0600 Subject: [PATCH 15/21] Typo --- app/models/account/seeder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index 7480ca88f..350651615 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -55,7 +55,7 @@ class Account::Seeder

Click the little head with the + next to it, pick yourself.

HTML - playground.cards.create! creator: creator, title: "Tag this card “Design” the move it to YES", status: "published", description: <<~HTML + playground.cards.create! creator: creator, title: "Tag this card “Design” then move it to YES", status: "published", description: <<~HTML

Click the little Tag icon, type Design, then save. Then, move the card to the new “YES” column you created in the previous step.

HTML From fbf7b6cda709c2f8594428d978aa840194628a74 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 14:27:20 -0600 Subject: [PATCH 16/21] No need to create a default collection The playground is enough --- app/models/account/seedeable.rb | 2 -- app/models/collection.rb | 9 --------- app/views/collections/edit/_delete.html.erb | 11 +++++------ test/models/account/seedeable_test.rb | 10 +--------- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/app/models/account/seedeable.rb b/app/models/account/seedeable.rb index a4096c28e..3cceae251 100644 --- a/app/models/account/seedeable.rb +++ b/app/models/account/seedeable.rb @@ -3,8 +3,6 @@ module Account::Seedeable def setup_basic_template user = User.first - - Collection.create!(name: "Cards", creator: user, all_access: true) end def setup_customer_template diff --git a/app/models/collection.rb b/app/models/collection.rb index 504439e2e..7b756409d 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -12,13 +12,4 @@ class Collection < ApplicationRecord scope :alphabetically, -> { order("lower(name)") } scope :ordered_by_recently_accessed, -> { merge(Access.ordered_by_recently_accessed) } - - after_destroy_commit :ensure_default_collection - - private - def ensure_default_collection - if Collection.count.zero? - Collection.create!(name: "Cards") - end - end end diff --git a/app/views/collections/edit/_delete.html.erb b/app/views/collections/edit/_delete.html.erb index 7f13e84b1..627bfd1bd 100644 --- a/app/views/collections/edit/_delete.html.erb +++ b/app/views/collections/edit/_delete.html.erb @@ -1,8 +1,7 @@ -<% if Current.user.collections.many? %> - <%= form_with model: collection, class: "txt-align-center margin-block-start-auto", method: :delete do |form| %> - <%= form.button class: "btn txt-negative borderless txt-small", data: { turbo_confirm: "Are you sure you want to permanently delete this board?" } do %> - <%= icon_tag "trash" %> - Delete this board - <% end %> +<%= form_with model: collection, class: "txt-align-center margin-block-start-auto", method: :delete do |form| %> + <%= form.button class: "btn txt-negative borderless txt-small", data: { turbo_confirm: "Are you sure you want to permanently delete this board?" } do %> + <%= icon_tag "trash" %> + Delete this board <% end %> <% end %> + diff --git a/test/models/account/seedeable_test.rb b/test/models/account/seedeable_test.rb index 010df5661..aba88a2a5 100644 --- a/test/models/account/seedeable_test.rb +++ b/test/models/account/seedeable_test.rb @@ -5,18 +5,10 @@ class Account::SedeableTest < ActiveSupport::TestCase @account = Account.sole end - test "setup_basic_template adds collections" do - assert_changes -> { Collection.count } do - @account.setup_basic_template - end - end - test "setup_customer_template adds collections, cards, and comments" do assert_changes -> { Collection.count } do assert_changes -> { Card.count } do - assert_changes -> { Comment.count } do - @account.setup_customer_template - end + @account.setup_customer_template end end end From 370137919bd9e48be1f65e2a5013fc62639d0125 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 16:16:50 -0600 Subject: [PATCH 17/21] Copy edits --- app/models/account/seeder.rb | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index 350651615..d89c1287b 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -31,8 +31,12 @@ class Account::Seeder playground = Collection.create! name: "Playground", creator: creator, all_access: true # Cards - have_fun_card = playground.cards.create! creator: creator, title: "Have fun!", status: "published", description: <<~HTML -

Mess around, make more boards, add more cards, and get your work, issues, or ideas organized! Include a video of the full product walkthrough.

+ have_fun_card = playground.cards.create! creator: creator, title: "Watch this: Fizzy orientation video", status: "published", description: <<~HTML +

There’s a whole lot more you can do in Fizzy. In the video below 37signals founder and CEO, Jason Fried, will walk you through the basics in just 8 minutes.

+ HTML + + playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML +

Open Fizzy menu, select “+ Add people”, then copy the invite link. You can give this link to someone else so they can make an login for themselves in your account.

HTML playground.cards.create! creator: creator, title: "Head back home to check out activity", status: "published", description: <<~HTML @@ -40,15 +44,11 @@ class Account::Seeder HTML playground.cards.create! creator: creator, title: "Check out all cards assigned to you", status: "published", description: <<~HTML -

Pull down the Fizzy menu at the top of the screen, and select “Assigned to me” or just type “3” any time.

+

Pull down the Fizzy menu at the top of the screen, and select “Assigned to me” or just hit “3” on your keyboard any time.

HTML - playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML -

Pull down the Fizzy menu at the top of the screen, select “Account” or just hit 6, then grab the invite link over on the left side. You can give this link to someone else so they can make an login for themselves in your account.

- HTML - - playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML -

Pull down the Fizzy menu at the top of the screen, select “Account” or just hit 6, then grab the invite link over on the left side. You can give this link to someone else so they can make an login for themselves in your account.

+ playground.cards.create! creator: creator, title: "Open the Fizzy menu", status: "published", description: <<~HTML +

The Fizzy menu is how you get around the app. Click “Fizzy” at the top of the screen or hit the “J” key on your keyboard to pop it open.

HTML playground.cards.create! creator: creator, title: "Assign this card to yourself", status: "published", description: <<~HTML @@ -56,7 +56,7 @@ class Account::Seeder HTML playground.cards.create! creator: creator, title: "Tag this card “Design” then move it to YES", status: "published", description: <<~HTML -

Click the little Tag icon, type Design, then save. Then, move the card to the new “YES” column you created in the previous step.

+

Click the little Tag icon, type “design”, then “Create tag”. Then, move the card to the new “YES” column you created in the previous step.

HTML playground.cards.create! creator: creator, title: "Make two more columns", status: "published", description: <<~HTML @@ -71,11 +71,15 @@ class Account::Seeder HTML playground.cards.create! creator: creator, title: "Move this card to NOT NOW", status: "published", description: <<~HTML -

You can either select “NOT NOW” over in the sidebar, or you can go back out to the Board view and drag this card into the NOT NOW column on the left side.

+

You can either select “NOT NOW” over in the sidebar, or you can go back out to the board view and drag this card into the “NOT NOW” column on the left side.

HTML playground.cards.create! creator: creator, title: "Rename this card", status: "published", description: <<~HTML -

Click the title and you can rename the card, change the description, or add more information to the card.

+
    +
  1. Click the title and you can rename the card, change the description, or add more information to the card.
  2. +
  3. Then, hit "Mark as Done" at the bottom of the card.
  4. +
  5. Finally, hit “←Playground” in the top left of the screen to go back to the board.
  6. +
HTML end From 2d197601b713cc9f0bde032b76262dd5228d2799 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Mon, 3 Nov 2025 17:47:30 -0600 Subject: [PATCH 18/21] Add JF's fizzy orientation video --- app/models/account/seeder.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index d89c1287b..540273993 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -33,6 +33,8 @@ class Account::Seeder # Cards have_fun_card = playground.cards.create! creator: creator, title: "Watch this: Fizzy orientation video", status: "published", description: <<~HTML

There’s a whole lot more you can do in Fizzy. In the video below 37signals founder and CEO, Jason Fried, will walk you through the basics in just 8 minutes.

+


+ HTML playground.cards.create! creator: creator, title: "Grab the invite link to invite someone else", status: "published", description: <<~HTML From f104e31f3ffc5adff9200a9a1ff555e2ab0acef1 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 4 Nov 2025 05:06:18 +0100 Subject: [PATCH 19/21] Remove unused method --- app/models/account/seedeable.rb | 4 ---- db/seeds.rb | 1 - script/create-account.rb | 3 --- 3 files changed, 8 deletions(-) diff --git a/app/models/account/seedeable.rb b/app/models/account/seedeable.rb index 3cceae251..7e080d6ba 100644 --- a/app/models/account/seedeable.rb +++ b/app/models/account/seedeable.rb @@ -1,10 +1,6 @@ module Account::Seedeable extend ActiveSupport::Concern - def setup_basic_template - user = User.first - end - def setup_customer_template Account::Seeder.new(self, User.active.first).seed end diff --git a/db/seeds.rb b/db/seeds.rb index f70c87ccd..2d1002463 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -27,7 +27,6 @@ def create_tenant(signal_account_name) membership: membership } ) - account.setup_basic_template end ApplicationRecord.current_tenant = tenant_id diff --git a/script/create-account.rb b/script/create-account.rb index f0cf2b16a..1a3a7cca4 100755 --- a/script/create-account.rb +++ b/script/create-account.rb @@ -68,9 +68,6 @@ Current.set( email_address: owner_email } ) - - # Setup basic template - account.setup_basic_template end puts "✓ Tenant created" From 445ee48b0d4cfb5a3490aa18148a68e189d2d957 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 4 Nov 2025 05:07:26 +0100 Subject: [PATCH 20/21] Format --- lib/tasks/seed.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake index 4c7dd3937..71483eaf8 100644 --- a/lib/tasks/seed.rake +++ b/lib/tasks/seed.rake @@ -1,6 +1,6 @@ namespace :seed do desc "Seed customer data for a specific account (e.g: rails seed:customer ARTENANT=1234)" - task :customer, [:tenant_id] => "db:tenant" do |t, args| + task :customer, [ :tenant_id ] => "db:tenant" do |t, args| raise "Please provide a tenant ID: rails seed:customer ARTENANT=1234" unless ApplicationRecord.current_tenant account = Account.sole From ed518bac71f5d7e954ad476305e5b106c81e1de7 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 4 Nov 2025 05:09:48 +0100 Subject: [PATCH 21/21] Remove unused var --- app/models/account/seeder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/account/seeder.rb b/app/models/account/seeder.rb index 540273993..80af1251a 100644 --- a/app/models/account/seeder.rb +++ b/app/models/account/seeder.rb @@ -31,7 +31,7 @@ class Account::Seeder playground = Collection.create! name: "Playground", creator: creator, all_access: true # Cards - have_fun_card = playground.cards.create! creator: creator, title: "Watch this: Fizzy orientation video", status: "published", description: <<~HTML + playground.cards.create! creator: creator, title: "Watch this: Fizzy orientation video", status: "published", description: <<~HTML

There’s a whole lot more you can do in Fizzy. In the video below 37signals founder and CEO, Jason Fried, will walk you through the basics in just 8 minutes.