Conversation
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit fa82860. ♻️ This comment has been updated with latest results. |
2f8952e to
367b396
Compare
| options.add_argument('--window-size=1920,1080') | ||
| options.add_argument('--no-sandbox') | ||
| # options.add_argument('--disable-dev-shm-usage') | ||
| options.add_argument('--disable-dev-shm-usage') |
There was a problem hiding this comment.
failing to run in docker container
There was a problem hiding this comment.
Claude: The controller loads @series with includes(episodes: :article), which pre-loads @series.episodes into an in-memory cache. Rails 7 uses inverse_of auto-detection for belongs_to :series ↔ has_many :episodes, so when Episode.create(series: @series, ...) is called, the new unsaved episode is added to @series.episodes.target (the in-memory cache).
When accomodate_new_number ran before the fix, series.episodes.each iterated that stale cache — which included the new unsaved record itself. When the loop reached self, it called update_column on a new (unpersisted) record, which raises ActiveRecord::ActiveRecordError: cannot update a new record. This caused the positional shift to fail, so the episode fell through to max + 1 (position 3) instead of the requested position 1.
update_all executes a single UPDATE ... WHERE series_id = ? AND number >= ? directly against the database. Because the new episode hasn't been saved yet, it doesn't exist in the episodes table and is never touched by the query. The stale in-memory cache is bypassed entirely.
Fixed the admin/items page to search for items with a given fee id.
…ay-the-manage-event-button-for-users-with-the-treasurer-role Gave treasurers the ability to see and click on the manage event button.
Add requires to run tests locally add github ci workflow adjust docker compose command copy example files adjust database example file create db command remove formater remove requried byebug remove byebug use remove coverage steps remove publish coverage results Adjust app setup and docker setup adjust capybara drivers config - remove capybara_lockstep from application layout prevent dockerfile and selenium conflict remove double block add one more iframe layer Change iframe css finders debug pay spec in ci setup iframes setup iframes with correct selectors setup iframes with correct selectors adjust to new strategy test adding address to card.js.erb adjust cofirmpayment code add 5 seconds to confirm payment add postal code update clicable button add new rescue and wait time
Both accomodate_new_number and squash_old_numbers iterated series.episodes using the in-memory association cache (loaded via includes(episodes: :article) in the controller set_series). Due to Rails inverse_of auto-detection, when a new Episode is built with series: @Series, it gets added to @series.episodes.target. The shift loop then calls update_column on this unsaved record, which raises ActiveRecord::ActiveRecordError: cannot update a new record. This prevented the positional shift from completing correctly, so the new episode ended up at max + 1 (position 3) instead of the requested position 1. Fix: Replaced both each + update_column loops with update_all SQL: series.episodes.where("number >= ?", number).update_all("number = number + 1") — shifts existing episodes up to make room for the new one at the requested position series.episodes.where("number > ?", number).update_all("number = number - 1") — squashes gaps after a destroy update_all executes a single UPDATE SQL statement directly against the DB, bypassing the stale association cache and never touching the unsaved new record. The same pattern was applied to squash_old_numbers for consistency (the same stale-cache issue exists there for the self record just before its destroyed). adjust spec adjust readme
a4a351e to
302bb6e
Compare
This PR adds docker setup and Github CI workflow