Skip to content

Commit

Permalink
modify updating week for games
Browse files Browse the repository at this point in the history
  • Loading branch information
kortirso committed Mar 26, 2024
1 parent 7ba5f01 commit 6b09fc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ GEM
msgpack (~> 1.2)
brakeman (6.1.2)
racc
bugsnag (6.26.3)
bugsnag (6.26.4)
concurrent-ruby (~> 1.0)
builder (3.2.4)
capistrano (3.18.0)
Expand Down Expand Up @@ -365,12 +365,12 @@ GEM
redis-activesupport (5.3.0)
activesupport (>= 3, < 8)
redis-store (>= 1.3, < 2)
redis-client (0.21.0)
redis-client (0.21.1)
connection_pool
redis-store (1.10.0)
redis (>= 4, < 6)
regexp_parser (2.9.0)
reline (0.4.3)
reline (0.5.0)
io-console (~> 0.5)
rexml (3.2.6)
rspec (3.13.0)
Expand Down Expand Up @@ -414,7 +414,7 @@ GEM
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.24.0)
rubocop-rails (2.24.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
Expand Down
2 changes: 1 addition & 1 deletion app/forms/games/update_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call(game:, params:)
errors = validator.call(params: params)
return { errors: errors } if errors.any?

new_week = Week.future.find_by(season_id: game.week.season_id, id: params[:week_id]) if params[:week_id].present?
new_week = Week.future.find_by(id: params[:week_id]) if params[:week_id].present?
return { errors: ['Week does not exist'] } if params[:week_id].present? && new_week.nil?

ActiveRecord::Base.transaction do
Expand Down

0 comments on commit 6b09fc2

Please sign in to comment.