From 7506a3992b5e979b4f3c82c23ea4a4f04e1c37fc Mon Sep 17 00:00:00 2001 From: Katlyn Alo <26312638+Kat-Alo@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:10:42 -0600 Subject: [PATCH 1/3] adding miss_hannigan gem to delete more efficiently --- Gemfile | 2 ++ Gemfile.lock | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index dbfb7954..4ce639e0 100644 --- a/Gemfile +++ b/Gemfile @@ -32,6 +32,8 @@ gem 'rails-healthcheck' gem 'ddtrace', require: 'ddtrace/auto_instrument' +gem 'miss_hannigan' + group :development, :test do gem 'byebug' gem 'rspec-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 1e7921ef..a90366a4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,6 +182,8 @@ GEM mini_racer (0.6.3) libv8-node (~> 16.10.0.0) minitest (5.17.0) + miss_hannigan (0.1.2) + rails (>= 5.1) msgpack (1.6.0) multi_xml (0.6.0) mustermann (3.0.0) @@ -380,6 +382,7 @@ DEPENDENCIES kramdown letter_opener mini_racer (~> 0.6.3) + miss_hannigan pg (~> 1.4) premailer-rails puma (~> 5.6) From d20ac08c403dac8cea25f1f7b8ebd7020113e262 Mon Sep 17 00:00:00 2001 From: Katlyn Alo <26312638+Kat-Alo@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:12:56 -0600 Subject: [PATCH 2/3] using miss hannigan to nullify child to parent relationship before destroy --- app/models/page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/page.rb b/app/models/page.rb index e2ba5081..bb372502 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,7 +1,7 @@ class Page < ApplicationRecord belongs_to :user - has_many :page_snapshots, dependent: :destroy + has_many :page_snapshots, dependent: :nullify_then_purge attr_accessor :subscriptions # Gets set in controller on update/create after_create :update_subscriptions From 8855cc19eea5d16dd468dd4933c87bba8a98c880 Mon Sep 17 00:00:00 2001 From: Katlyn Alo <26312638+Kat-Alo@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:16:38 -0600 Subject: [PATCH 3/3] commenting out github workflow since we aren't using tests yet --- .github/workflows/ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee013289..d612ebee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,20 +24,20 @@ jobs: ports: - 5432:5432 - steps: - - name: Checkout the project - uses: actions/checkout@v3 + # steps: + # - name: Checkout the project + # uses: actions/checkout@v3 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true + # - name: Set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # bundler-cache: true - - name: Compile assets - run: bundle exec rake assets:precompile assets:clean + # - name: Compile assets + # run: bundle exec rake assets:precompile assets:clean - - name: Prepare the database - run: bundle exec rake db:create db:schema:load --trace + # - name: Prepare the database + # run: bundle exec rake db:create db:schema:load --trace - - name: Run the tests - run: bundle exec rspec --tag ~skip --tag ~pending --format RSpec::Github::Formatter + # - name: Run the tests + # run: bundle exec rspec --tag ~skip --tag ~pending --format RSpec::Github::Formatter