diff --git a/Gemfile b/Gemfile index aaca1204..1cf250f0 100644 --- a/Gemfile +++ b/Gemfile @@ -89,7 +89,7 @@ gem 'skylight' gem 'bugsnag' # view pagination -gem 'pagy', '~> 6.0' +gem 'pagy', '~> 8.0' # notification layer gem 'active_delivery' diff --git a/Gemfile.lock b/Gemfile.lock index 0baeadf2..7056c12f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,35 +28,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.2) - actionpack (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.2) - actionview (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -64,37 +64,37 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.2) - actionpack (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.2) - activesupport (= 7.1.3.2) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) active_delivery (1.2.0) ruby-next-core (~> 1.0) - activejob (7.1.3.2) - activesupport (= 7.1.3.2) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.3.2) - activesupport (= 7.1.3.2) - activerecord (7.1.3.2) - activemodel (= 7.1.3.2) - activesupport (= 7.1.3.2) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) timeout (>= 0.4.0) - activestorage (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activesupport (= 7.1.3.2) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) marcel (~> 1.0) - activesupport (7.1.3.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -112,19 +112,12 @@ GEM awesome_print (1.9.2) base64 (0.2.0) bcrypt (3.1.20) - better_html (2.1.1) - actionview (>= 6.0) - activesupport (>= 6.0) - ast (~> 2.0) - erubi (~> 1.4) - parser (>= 2.4) - smart_properties - bigdecimal (3.1.7) + bigdecimal (3.1.8) bootsnap (1.18.3) msgpack (~> 1.2) brakeman (6.1.2) racc - bugsnag (6.26.4) + bugsnag (6.27.0) concurrent-ruby (~> 1.0) builder (3.2.4) capistrano (3.18.0) @@ -175,7 +168,7 @@ GEM concurrent-ruby (~> 1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) - dry-schema (1.13.3) + dry-schema (1.13.4) concurrent-ruby (~> 1.0) dry-configurable (~> 1.0, >= 1.0.1) dry-core (~> 1.0, < 2) @@ -196,7 +189,8 @@ GEM dry-initializer (~> 3.0) dry-schema (>= 1.12, < 2) zeitwerk (~> 2.6) - emailbutler (0.7.5) + emailbutler (0.8.0) + dry-container (~> 0.11.0) pagy (> 4.0) rails (> 6.0.0) sassc-rails @@ -217,12 +211,11 @@ GEM globalid (1.2.1) activesupport (>= 6.1) highline (3.0.1) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) - i18n-tasks (1.0.13) + i18n-tasks (1.0.14) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi highline (>= 2.0.0) i18n @@ -231,8 +224,8 @@ GEM rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) jsbundling-rails (1.3.0) railties (>= 6.0.0) @@ -247,7 +240,7 @@ GEM kudos (0.1.3) rails (> 6.0.0) language_server-protocol (3.17.0.3) - launchy (3.0.0) + launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) letter_opener (1.10.0) @@ -263,13 +256,13 @@ GEM marcel (1.0.4) method_source (1.1.0) mini_mime (1.1.5) - minitest (5.22.3) + minitest (5.23.1) msgpack (1.7.2) multi_json (1.15.0) mutex_m (0.2.0) net-http (0.4.1) uri - net-imap (0.4.10) + net-imap (0.4.11) date net-protocol net-pop (0.1.2) @@ -283,20 +276,20 @@ GEM net-smtp (0.5.0) net-protocol net-ssh (7.2.3) - nio4r (2.7.1) - nokogiri (1.16.4-arm64-darwin) + nio4r (2.7.3) + nokogiri (1.16.5-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86_64-darwin) + nokogiri (1.16.5-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.4-x86_64-linux) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) - pagy (6.4.4) + pagy (8.4.0) parallel (1.24.0) parser (3.3.1.0) ast (~> 2.4.1) racc pg (1.5.6) - pghero (3.4.1) + pghero (3.5.0) activerecord (>= 6) psych (5.1.2) stringio @@ -308,8 +301,8 @@ GEM que (> 2.0) rails (> 6.0.0) sassc-rails - racc (1.7.3) - rack (3.0.10) + racc (1.8.0) + rack (3.0.11) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -317,20 +310,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.2) - actioncable (= 7.1.3.2) - actionmailbox (= 7.1.3.2) - actionmailer (= 7.1.3.2) - actionpack (= 7.1.3.2) - actiontext (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activemodel (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) bundler (>= 1.15.0) - railties (= 7.1.3.2) + railties (= 7.1.3.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -345,9 +338,9 @@ GEM rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -355,7 +348,7 @@ GEM zeitwerk (~> 2.6) rainbow (3.1.1) rake (13.2.1) - rdoc (6.6.3.1) + rdoc (6.7.0) psych (>= 4.0.0) recaptcha (5.16.0) redis (5.2.0) @@ -367,14 +360,15 @@ GEM redis-activesupport (5.3.0) activesupport (>= 3, < 8) redis-store (>= 1.3, < 2) - redis-client (0.22.1) + redis-client (0.22.2) connection_pool redis-store (1.10.0) redis (>= 4, < 6) - regexp_parser (2.9.0) - reline (0.5.3) + regexp_parser (2.9.2) + reline (0.5.7) io-console (~> 0.5) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) @@ -384,7 +378,7 @@ GEM rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-rails (6.1.2) @@ -396,7 +390,7 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.1) - rubocop (1.63.4) + rubocop (1.64.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -407,8 +401,8 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-factory_bot (2.25.1) @@ -416,12 +410,12 @@ GEM rubocop-performance (1.21.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.24.1) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (2.29.1) + rubocop-rspec (2.29.2) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) @@ -448,7 +442,6 @@ GEM simplecov_json_formatter (0.1.4) skylight (6.0.4) activesupport (>= 5.2.0) - smart_properties (1.17.0) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -456,7 +449,7 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sshkit (1.22.1) + sshkit (1.22.2) base64 mutex_m net-scp (>= 1.1.2) @@ -465,12 +458,13 @@ GEM stringio (3.1.0) strong_migrations (1.8.0) activerecord (>= 5.2) - tailwindcss-rails (2.5.0-arm64-darwin) - railties (>= 6.0.0) - tailwindcss-rails (2.5.0-x86_64-darwin) - railties (>= 6.0.0) - tailwindcss-rails (2.5.0-x86_64-linux) - railties (>= 6.0.0) + strscan (3.1.0) + tailwindcss-rails (2.6.0-arm64-darwin) + railties (>= 7.0.0) + tailwindcss-rails (2.6.0-x86_64-darwin) + railties (>= 7.0.0) + tailwindcss-rails (2.6.0-x86_64-linux) + railties (>= 7.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.1) @@ -492,7 +486,7 @@ GEM websocket-extensions (0.1.5) whenever (1.0.0) chronic (>= 0.6.3) - zeitwerk (2.6.13) + zeitwerk (2.6.14) PLATFORMS arm64-darwin-22 @@ -529,7 +523,7 @@ DEPENDENCIES jwt (~> 2.5) kudos letter_opener - pagy (~> 6.0) + pagy (~> 8.0) pg (~> 1.4) pghero puma (~> 6.0) diff --git a/app/jobs/scheduler_job.rb b/app/jobs/scheduler_job.rb index ea932000..e2e3f6d2 100644 --- a/app/jobs/scheduler_job.rb +++ b/app/jobs/scheduler_job.rb @@ -34,7 +34,7 @@ def import_games Game .joins(:week) .where(weeks: { status: Week::ACTIVE, season_id: season[:id] }) - .where('start_at < ?', 165.minutes.ago) + .where(start_at: ...165.minutes.ago) .where(points: []) .pluck(:id) next if game_ids.blank? diff --git a/app/jobs/teams/players/correct_prices_job.rb b/app/jobs/teams/players/correct_prices_job.rb index d2cb9daa..c3b53643 100644 --- a/app/jobs/teams/players/correct_prices_job.rb +++ b/app/jobs/teams/players/correct_prices_job.rb @@ -42,7 +42,7 @@ def update_top_cheap_players(ids, price_change) def update_lazy_players scope - .where('price_cents >= ?', 1_000) + .where(price_cents: 1_000..) .hashable_pluck(:id, :price_cents, :seasons_team_id, :player_id, :players_season_id) .each do |teams_player| coef = low_price_players[teams_player[:id]].to_f @@ -71,7 +71,7 @@ def low_price_players @low_price_players ||= scope .joins(:players_season) - .where('price_cents < ?', 1_500) + .where(price_cents: ...1_500) .where.not(players_seasons: { average_points: 0 }) .hashable_pluck(:id, :price_cents, 'players_seasons.average_points') .each_with_object({}) do |teams_player, acc| diff --git a/app/jobs/users/sessions/remove_expired_job.rb b/app/jobs/users/sessions/remove_expired_job.rb index 31d02f77..455258aa 100644 --- a/app/jobs/users/sessions/remove_expired_job.rb +++ b/app/jobs/users/sessions/remove_expired_job.rb @@ -7,7 +7,7 @@ class RemoveExpiredJob < ApplicationJob def perform Users::Session - .where('created_at < ?', JwtEncoder::EXPIRATION_SECONDS.seconds.ago) + .where(created_at: ...JwtEncoder::EXPIRATION_SECONDS.seconds.ago) .destroy_all end end diff --git a/app/models/injury.rb b/app/models/injury.rb index 16e2bdeb..b6afd310 100644 --- a/app/models/injury.rb +++ b/app/models/injury.rb @@ -4,5 +4,5 @@ class Injury < ApplicationRecord belongs_to :players_season, class_name: '::Players::Season', touch: true scope :active, -> { where(return_at: nil).or(where('return_at > ?', DateTime.now)) } - scope :inactive, -> { where.not(return_at: nil).where('return_at < ?', DateTime.now) } + scope :inactive, -> { where.not(return_at: nil).where(return_at: ...DateTime.now) } end diff --git a/app/models/week.rb b/app/models/week.rb index 85772944..f2cd76e0 100644 --- a/app/models/week.rb +++ b/app/models/week.rb @@ -48,7 +48,7 @@ def next def weeks_ids_for_form_calculation Week .where(season_id: season_id) - .where('position <= ?', position) + .where(position: ..position) .where('position > ?', position - WEEKS_COUNT_FOR_FORM[season.league.sport_kind]) .order(position: :desc) .ids diff --git a/app/serializers/controllers/fantasy_teams/players/index_serializer.rb b/app/serializers/controllers/fantasy_teams/players/index_serializer.rb index 87f4d35a..7ab6aee5 100644 --- a/app/serializers/controllers/fantasy_teams/players/index_serializer.rb +++ b/app/serializers/controllers/fantasy_teams/players/index_serializer.rb @@ -16,7 +16,7 @@ class IndexSerializer < ::Players::SeasonSerializer seasons_team .games .includes(:week, :home_season_team) - .where('weeks.id >= ?', params[:week_id]) + .where(weeks: { id: params[:week_id].. }) .order('weeks.position ASC', 'start_at ASC') .limit(4) .hashable_pluck(:difficulty, :home_season_team_id) diff --git a/app/services/fantasy_teams/lineups/generate_sample_service.rb b/app/services/fantasy_teams/lineups/generate_sample_service.rb index 2ae930d6..0ec988ae 100644 --- a/app/services/fantasy_teams/lineups/generate_sample_service.rb +++ b/app/services/fantasy_teams/lineups/generate_sample_service.rb @@ -54,7 +54,7 @@ def initialize_variables def grouped_teams_players @season .active_teams_players - .where('price_cents <= ?', @price_cents_per_player) + .where(price_cents: ..@price_cents_per_player) .includes(:player) .group_by(&:seasons_team_id) .sort_by { rand } diff --git a/app/services/games/difficulty_update_service.rb b/app/services/games/difficulty_update_service.rb index d831adcb..be2cf700 100644 --- a/app/services/games/difficulty_update_service.rb +++ b/app/services/games/difficulty_update_service.rb @@ -33,7 +33,7 @@ def generate_payload(week, points_system, members_in_group) end def finished_week_ids(week) - week.season.weeks.where('position < ?', week.position - 1).select(:id) + week.season.weeks.where(position: ...week.position - 1).select(:id) end def points_for_game(game, points_system) @@ -74,7 +74,7 @@ def set_difficulties_for_next_weeks(week, seasons_teams_difficulties) def next_week_ids(week) week.season.weeks - .where('position >= ? AND position <= ?', week.position, week.position + 3) + .where(position: week.position..week.position + 3) .select(:id) end diff --git a/config/initializers/emailbutler.rb b/config/initializers/emailbutler.rb index 87e9076e..d2ea00ad 100644 --- a/config/initializers/emailbutler.rb +++ b/config/initializers/emailbutler.rb @@ -6,6 +6,7 @@ credentials = Rails.application.credentials config.adapter = Emailbutler::Adapters::ActiveRecord.new + config.providers = %w[smtp2go] config.ui_username = credentials.dig(:emailbutler, :username) config.ui_password = credentials.dig(:emailbutler, :password) config.ui_secured_environments = ['production']