Skip to content

Bugfix/vue not loading#1110

Merged
lodewiges merged 4 commits intostagingfrom
Bugfix/VueNotLoading
Nov 2, 2025
Merged

Bugfix/vue not loading#1110
lodewiges merged 4 commits intostagingfrom
Bugfix/VueNotLoading

Conversation

@lodewiges
Copy link
Copy Markdown
Contributor

@lodewiges lodewiges commented Nov 1, 2025

Quick bug fix for Vue not loading properly

Summary by CodeRabbit

  • Bug Fixes

    • Corrected age verification checks on the order screen to properly display and enforce age-restricted product requirements.
  • Refactor

    • Streamlined internal age verification method structure.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 1, 2025

Walkthrough

The changes refactor the User model method from minor? to minor, updating all references across the controller, views, and tests. The migration file adds explicit precision and scale parameters for column removal.

Changes

Cohort / File(s) Summary
Method rename refactoring
app/models/user.rb, app/controllers/activities_controller.rb, app/views/activities/order_screen.html.erb, spec/models/user_spec.rb
Renames public method minor? to minor in User model; updates serialization in orderscreen_json_includes; fixes Vue binding expressions by removing extra ? in conditional checks (:class and v-if); updates all test expectations to reference the renamed method.
Migration precision parameters
db/migrate/20251026202155_remove_order_total_from_orders.rb
Adds explicit precision: 8 and scale: 2 parameters to column removal in migration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the method rename is applied consistently across all references
  • Confirm Vue binding syntax in order_screen.html.erb is correct after removing the extra ?
  • Ensure test expectations accurately reflect the new method name and return value semantics

Poem

🐰 From question marks to straightforward calls,
A method's name through codebase falls,
Vue bindings fixed with gentle care,
Migrations precise, refactoring fair!

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is significantly incomplete compared to the required template. The provided description ("Quick bug fix for Vue not loading properly") is a single vague sentence that fails to address any of the template sections: no checklist is present (missing database migration verification steps), no detailed summary of changes is provided, no screenshots are included, no related issues are mentioned, and no other relevant information is documented. The description does not explain the actual changes—the renaming of the minor? method to minor, the necessary updates across multiple files, or the existence of a database migration.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "Bugfix/vue not loading" refers to a real aspect of the changeset—the fix to Vue binding expressions in the template file by removing extra question marks. However, the title does not fully capture the primary scope of the changes, which is renaming the minor? predicate method to minor throughout the codebase (model, controller, tests, and migrations) to make it compatible with Vue property bindings. The title is somewhat vague about what "not loading" means and reflects only the symptom rather than the root cause of the fix.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Bugfix/VueNotLoading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.10%. Comparing base (04a5d73) to head (c169256).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
app/controllers/activities_controller.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           staging    #1110   +/-   ##
========================================
  Coverage    74.10%   74.10%           
========================================
  Files           51       51           
  Lines         1093     1093           
========================================
  Hits           810      810           
  Misses         283      283           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25d28e5 and c169256.

📒 Files selected for processing (1)
  • db/migrate/20251026202155_remove_order_total_from_orders.rb (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

Comment on lines 1 to 5
class RemoveOrderTotalFromOrders < ActiveRecord::Migration[7.2]
def change
remove_column :orders, :order_total, :decimal
remove_column :orders, :order_total, :decimal, precision: 8, scale: 2
end
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify this migration file belongs in this PR.

This migration removes the order_total column from the orders table, but the PR is titled "Bugfix/vue not loading" and describes fixing Vue loading issues. Additionally, the AI summary mentions refactoring the User model (minor? to minor), which is unrelated to this orders table change.

Please confirm:

  1. Is this migration file intended for this PR?
  2. Should this be part of a separate database cleanup PR?

🏁 Script executed:

#!/bin/bash
# Search for references to order_total in the codebase
echo "=== Searching for order_total references ==="
rg -n "order_total" --type=rb --type=ts --type=js --type=jsx --type=tsx -C 3

echo ""
echo "=== Searching for remove_column references in migrations ==="
rg -n "remove_column.*:orders" --type=rb -C 2

echo ""
echo "=== Checking Order model for order_total attribute ==="
fd -e rb -path "*/models/*" -exec rg -l "class Order" {} \;

Length of output: 385


🏁 Script executed:

#!/bin/bash
# Search for all references to order_total in the codebase
echo "=== Searching for order_total references ==="
rg -i "order_total" -C 3

echo ""
echo "=== Finding Order model ==="
fd -name "order.rb" -o -name "orders.rb"

echo ""
echo "=== Searching for remove_column in migrations ==="
rg "remove_column.*orders" -C 2

echo ""
echo "=== Looking for create_order_total or add_column order_total in migrations ==="
rg "order_total" db/migrate/ -C 2

Length of output: 15082


This migration will break active code—do not deploy without refactoring dependent code first.

The migration removes order_total column, but the code actively uses it throughout the application:

  1. API responses: app/controllers/orders_controller.rb serializes :order_total in JSON
  2. Controllers: app/controllers/users_controller.rb maps order_total to response
  3. Views: app/views/activities/show.html.erb and app/views/activities/_sumup_error_order_modal.html.erb display order.order_total
  4. Vue components: app/javascript/components/user/OrderHistory.vue and app/javascript/components/orderscreen/ActivityOrders.vue expect order_total in JSON responses
  5. Tests: spec/models/order_spec.rb and spec/models/user_spec.rb test order_total behavior

The Order model defines order_total as a calculated method, not a database column—verify if the column is even needed. If removing it, you must:

  • Remove :order_total from app/controllers/orders_controller.rb serialization (line in proper_json method)
  • Update app/controllers/users_controller.rb to compute totals instead of serializing column value
  • Update Vue component responses to exclude or recalculate order_total
  • Update tests accordingly

Also confirm this migration belongs in the "Bugfix/vue not loading" PR or move to a separate database cleanup PR.

🤖 Prompt for AI Agents
In db/migrate/20251026202155_remove_order_total_from_orders.rb lines 1-5, the
migration drops the order_total column but application code still expects that
field; either remove the migration from this PR or refactor the app before
running it. Fix by (1) verifying Order#order_total is a computed method and, if
so, remove this migration from the "Bugfix/vue not loading" PR and open a
separate DB cleanup PR; or (2) if you must keep the migration now, update the
code paths that read the column: remove :order_total from orders_controller
proper_json serialization, update users_controller to compute totals instead of
reading a column, update views (app/views/activities/*.erb) and Vue components
(app/javascript/components/**/OrderHistory.vue and ActivityOrders.vue) to use
the computed value from the model or recalculated totals from the API, and
update specs (spec/models/order_spec.rb and spec/models/user_spec.rb) to assert
computed behavior; run the test suite and API contract checks before deploying.

class RemoveOrderTotalFromOrders < ActiveRecord::Migration[7.2]
def change
remove_column :orders, :order_total, :decimal
remove_column :orders, :order_total, :decimal, precision: 8, scale: 2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify the order_total column is no longer referenced before removal.

Removing a database column is a destructive operation. Please ensure that:

  1. The order_total column is not referenced anywhere in the codebase
  2. Any dependent code has been updated to remove references
  3. Data has been migrated or is no longer needed

Run the following script to check for references to order_total:


🏁 Script executed:

#!/bin/bash
# Description: Search for references to order_total in the codebase

# Search for order_total references in Ruby files
rg -n --type=ruby -C3 '\border_total\b'

# Search for order_total in view files
rg -n --type=html -C3 '\border_total\b'

# Search for order_total in JavaScript/Vue files
fd -e js -e vue --exec rg -n -C3 '\border_total\b' {}

Length of output: 8440


🏁 Script executed:

#!/bin/bash
# Verify if column was re-added after 2017 removal
# Check for any 'add_column' operations on order_total after the 2017 removal

find db/migrate -name "*.rb" ! -path "*/archive/*" -type f | sort | while read file; do
  if grep -q "order_total" "$file"; then
    echo "=== $file ==="
    grep -n "order_total" "$file"
  fi
done

Length of output: 143


🏁 Script executed:

#!/bin/bash
# Check current database schema for orders table
grep -A 50 "create_table :orders" db/schema.rb | head -60

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Find schema files
ls -la db/ | grep -E "schema|structure"

# Also check if schema.rb exists at all
ls -la db/schema.rb 2>/dev/null || echo "schema.rb not found"

# List migration files to understand timeline
ls -1 db/migrate/*.rb 2>/dev/null | sort | tail -5

Length of output: 441


🏁 Script executed:

#!/bin/bash
# Search for orders table in schema.rb and show its definition
cat db/schema.rb | sed -n '/create_table "orders"/,/^  end$/p'

Length of output: 565


Remove this migration—the order_total column has already been removed.

The current schema shows the orders table no longer has an order_total column. The 2017 archive migration (20171006204230_change_product_price_total_to_product_price_amount.rb) already removed it. This migration will fail on execution because the column no longer exists.

The order_total references in the codebase are safe—they refer to the computed method in Order model (line 24-26 in app/models/order.rb), which calculates the sum from order_rows. Controllers serialize this method, and the frontend displays the API response data. The method does not depend on a database column.

Delete or do not commit this migration file.

🤖 Prompt for AI Agents
In db/migrate/20251026202155_remove_order_total_from_orders.rb around line 3,
this migration removes the :order_total column which already no longer exists
(it was removed by 20171006204230...), causing the migration to fail; delete
this migration file from the branch (or do not commit it) so it is not run,
ensuring no code references database column changes are needed because
Order#order_total is computed and already safe.

@lodewiges lodewiges merged commit 2f8aeb8 into staging Nov 2, 2025
5 of 6 checks passed
@lodewiges lodewiges deleted the Bugfix/VueNotLoading branch November 2, 2025 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant