From b95a05a82348eb78dcf658f6470a2c8478a104f2 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Sun, 26 Oct 2025 22:27:37 +0100 Subject: [PATCH 1/3] Initial commit --- app/views/layouts/application.html.erb | 4 +--- db/migrate/20251026202155_remove_order_total_from_orders.rb | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20251026202155_remove_order_total_from_orders.rb diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 052c43496..b4b4b1d3c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,9 +31,7 @@ environment: '<%= Rails.env %>', release: '<%= ENV['BUILD_HASH'] %>' }); - Sentry.configureScope(scope => { - scope.setUser({ id: <%= current_user&.id || 'null' %> }); - }); + Sentry.setUser({ id: <%= current_user&.id || 'null' %> }); <% end %> diff --git a/db/migrate/20251026202155_remove_order_total_from_orders.rb b/db/migrate/20251026202155_remove_order_total_from_orders.rb new file mode 100644 index 000000000..cb4095930 --- /dev/null +++ b/db/migrate/20251026202155_remove_order_total_from_orders.rb @@ -0,0 +1,5 @@ +class RemoveOrderTotalFromOrders < ActiveRecord::Migration[7.2] + def change + remove_column :orders, :order_total, :decimal + end +end From 24fc6c9f84e40e1f4260943d6d05e41fbc831677 Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Sun, 26 Oct 2025 22:39:24 +0100 Subject: [PATCH 2/3] ran migration --- app/views/layouts/application.html.erb | 2 +- db/schema.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b4b4b1d3c..f69349a09 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,7 +31,7 @@ environment: '<%= Rails.env %>', release: '<%= ENV['BUILD_HASH'] %>' }); - Sentry.setUser({ id: <%= current_user&.id || 'null' %> }); + Sentry.setUser({ id: <%= current_user&.id.to_json %> }); <% end %> diff --git a/db/schema.rb b/db/schema.rb index 12105bdff..7d2555c18 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2025_09_13_233761) do +ActiveRecord::Schema[7.2].define(version: 2025_10_26_202155) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -81,7 +81,6 @@ end create_table "orders", force: :cascade do |t| - t.decimal "order_total", precision: 8, scale: 2 t.bigint "activity_id", null: false t.bigint "user_id" t.datetime "deleted_at" From c5c6b141c9dc9c52c890fb3fb62dca834ec10bfb Mon Sep 17 00:00:00 2001 From: Lodewiges Date: Sun, 26 Oct 2025 23:15:16 +0100 Subject: [PATCH 3/3] update database_consistency gem and nodejs version --- Dockerfile | 2 +- Gemfile | 2 +- Gemfile.lock | 10 +++------- bin/ci.sh | 4 ++-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f5cb658fa..713882085 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN apt-get update -qq && \ libyaml-dev # Add Node, required for asset pipeline. -RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ +RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ npm install -q -g yarn diff --git a/Gemfile b/Gemfile index aa602b934..9ed8bad07 100644 --- a/Gemfile +++ b/Gemfile @@ -49,7 +49,7 @@ group :development, :test do gem 'brakeman', '~> 7.0.2', require: false gem 'bullet', '~> 8.0', '>= 8.0.8' gem 'colorize', '~> 1.1.0' - gem 'consistency_fail' + gem 'database_consistency', '~> 2.0.6' gem 'dotenv-rails', '~> 3.1.8' gem 'guard-livereload', '~> 2.5.2' gem 'guard-rspec', '~> 4.7.3', require: false diff --git a/Gemfile.lock b/Gemfile.lock index f95f33fe3..e183f7d91 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -112,8 +112,9 @@ GEM colorize (1.1.0) concurrent-ruby (1.3.5) connection_pool (2.5.4) - consistency_fail (0.3.7) crass (1.0.6) + database_consistency (2.0.6) + activerecord (>= 3.2) date (3.4.1) devise (4.9.4) bcrypt (~> 3.0) @@ -250,7 +251,6 @@ GEM mina (1.2.5) rake mini_mime (1.1.5) - mini_portile2 (2.8.9) minitest (5.25.5) mollie-api-ruby (4.17.0) bigdecimal (~> 3.1, >= 3.1.8) @@ -277,9 +277,6 @@ GEM net-ssh (7.3.0) netrc (0.11.0) nio4r (2.7.4) - nokogiri (1.18.8) - mini_portile2 (~> 2.8.2) - racc (~> 1.4) nokogiri (1.18.8-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) @@ -597,7 +594,6 @@ GEM zeitwerk (2.7.3) PLATFORMS - ruby x86_64-linux DEPENDENCIES @@ -610,7 +606,7 @@ DEPENDENCIES bullet (~> 8.0, >= 8.0.8) capistrano-sidekiq (~> 3.0.0) colorize (~> 1.1.0) - consistency_fail + database_consistency (~> 2.0.6) devise (~> 4.9.4) devise-i18n (~> 1.13.0) dotenv-rails (~> 3.1.8) diff --git a/bin/ci.sh b/bin/ci.sh index 251f5fe0d..1e87e5366 100755 --- a/bin/ci.sh +++ b/bin/ci.sh @@ -14,8 +14,8 @@ if [ "${TYPE}" = "lint" ] || [ "${TYPE}" = "" ]; then gem install bundler-audit bundle-audit update && bundle-audit check --ignore CVE-2015-9284 || true RAILS_ENV=test bundle exec rails db:create db:environment:set db:schema:load - # Don't check DB consistency until solved: https://github.com/trptcolin/consistency_fail/issues/42 - # bundle exec consistency_fail + # uncomment when it does not fail anymore :) + # bundle exec database_consistency echo "--- :eslint: Yarn lint" yarn install # Why do I need to do this again? This was done in Dockerfile, rite?