diff --git a/.rubocop.yml b/.rubocop.yml index d732cd51..b8679fff 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,6 +3,7 @@ require: - rubocop-factory_bot - rubocop-rails - rubocop-rspec + - rubocop-rspec_rails inherit_from: - .rubocop_todo.yml diff --git a/Gemfile.lock b/Gemfile.lock index 4b2486a4..052398ff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,35 +8,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.1) - actionpack (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) - actionpack (= 7.1.3.1) - activejob (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) - actionpack (= 7.1.3.1) - actionview (= 7.1.3.1) - activejob (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) - actionview (= 7.1.3.1) - activesupport (= 7.1.3.1) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -46,35 +46,35 @@ GEM rails-html-sanitizer (~> 1.6) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.1.3.1) - actionpack (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) - activesupport (= 7.1.3.1) + 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) - activejob (7.1.3.1) - activesupport (= 7.1.3.1) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.3.1) - activesupport (= 7.1.3.1) - activerecord (7.1.3.1) - activemodel (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) - actionpack (= 7.1.3.1) - activejob (= 7.1.3.1) - activerecord (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -88,9 +88,9 @@ GEM activerecord (>= 4.2) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) - airbrussh (1.5.1) + airbrussh (1.5.2) sshkit (>= 1.6.1, != 1.7.0) - alba (3.0.3) + alba (3.1.0) ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -98,12 +98,12 @@ GEM execjs (~> 2.0) base64 (0.2.0) bcrypt (3.1.20) - bigdecimal (3.1.6) + bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.18.3) msgpack (~> 1.2) builder (3.2.4) - capistrano (3.18.0) + capistrano (3.18.1) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) @@ -128,12 +128,13 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.3) connection_pool (2.4.1) - crack (0.4.6) + crack (1.0.0) bigdecimal rexml crass (1.0.6) cssbundling-rails (1.4.0) railties (>= 6.0.0) + csv (3.3.0) date (3.3.4) diff-lcs (1.5.1) dis (1.1.14) @@ -142,12 +143,11 @@ GEM pmap (~> 1.1.0) rails (> 5.0) docile (1.4.0) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) - drb (2.2.0) - ruby2_keywords + dotenv (3.1.2) + dotenv-rails (3.1.2) + dotenv (= 3.1.2) + railties (>= 6.1) + drb (2.2.1) dynamic_image (2.1.5) dis (~> 1.1, >= 1.0.6) mini_exiftool (~> 2.10) @@ -155,7 +155,9 @@ GEM rails (> 5.0) vector2d (~> 2.2, >= 2.2.1) erubi (1.12.0) - excon (0.109.0) + et-orbi (1.2.11) + tzinfo + excon (0.110.0) execjs (2.9.1) factory_bot (6.4.6) activesupport (>= 5.0.0) @@ -166,8 +168,8 @@ GEM faraday-net_http (>= 2.0, < 3.2) faraday-net_http (3.1.0) net-http - fastimage (2.3.0) - fog-aws (3.21.0) + fastimage (2.3.1) + fog-aws (3.22.0) fog-core (~> 2.1) fog-json (~> 1.1) fog-xml (~> 0.1) @@ -185,22 +187,26 @@ GEM fog-core nokogiri (>= 1.5.11, < 2.0.0) formatador (0.3.0) + fugit (1.10.1) + et-orbi (~> 1, >= 1.2.7) + raabro (~> 1.4) gemoji (4.1.0) globalid (1.2.1) activesupport (>= 6.1) hashdiff (1.1.0) - httparty (0.21.0) + httparty (0.22.0) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.14.1) + i18n (1.14.5) concurrent-ruby (~> 1.0) io-console (0.7.2) - irb (1.11.2) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) jsbundling-rails (1.3.0) railties (>= 6.0.0) - json (2.7.1) + json (2.7.2) json_spec (1.1.5) multi_json (~> 1.0) rspec (>= 2.0, < 4.0) @@ -213,24 +219,25 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1205) - mini_exiftool (2.10.4) + mime-types-data (3.2024.0507) + mini_exiftool (2.11.0) mini_magick (4.12.0) mini_mime (1.1.5) mini_portile2 (2.8.6) - minitest (5.22.2) + minitest (5.23.1) msgpack (1.7.2) multi_json (1.15.0) - multi_xml (0.6.0) + multi_xml (0.7.1) + bigdecimal (~> 3.1) 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) @@ -241,23 +248,23 @@ GEM net-ssh (>= 2.6.5, < 8.0.0) net-sftp (4.0.0) net-ssh (>= 5.0.0, < 8.0.0) - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol - net-ssh (7.2.1) - newrelic_rpm (9.7.1) - nio4r (2.7.0) + net-ssh (7.2.3) + newrelic_rpm (9.9.0) + nio4r (2.7.3) nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) - non-stupid-digest-assets (1.0.10) + non-stupid-digest-assets (1.0.11) sprockets (>= 2.0) parallel (1.24.0) - parser (3.3.0.5) + parser (3.3.1.0) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.6) pmap (1.1.1) pr_geohash (1.0.0) pry (0.14.2) @@ -265,11 +272,12 @@ GEM method_source (~> 1.0) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) - racc (1.7.3) - rack (3.0.9.1) + raabro (1.4.0) + racc (1.8.0) + rack (3.0.11) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -277,20 +285,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.1) - actioncable (= 7.1.3.1) - actionmailbox (= 7.1.3.1) - actionmailer (= 7.1.3.1) - actionpack (= 7.1.3.1) - actiontext (= 7.1.3.1) - actionview (= 7.1.3.1) - activejob (= 7.1.3.1) - activemodel (= 7.1.3.1) - activerecord (= 7.1.3.1) - activestorage (= 7.1.3.1) - activesupport (= 7.1.3.1) + 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.1) + railties (= 7.1.3.3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -302,31 +310,32 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.1) - actionpack (= 7.1.3.1) - activesupport (= 7.1.3.1) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) - rdoc (6.6.3.1) + rake (13.2.1) + rdoc (6.7.0) psych (>= 4.0.0) - react-rails (3.2.0) + react-rails (3.2.1) babel-transpiler (>= 0.7.0) connection_pool execjs railties (>= 3.2) tilt redcarpet (3.6.0) - regexp_parser (2.9.0) - reline (0.4.3) + regexp_parser (2.9.2) + reline (0.5.7) io-console (~> 0.5) - rexml (3.2.6) - rouge (4.2.0) - rsolr (2.5.0) + rexml (3.2.8) + strscan (>= 3.0.9) + rouge (4.2.1) + rsolr (2.6.0) builder (>= 2.1.2) faraday (>= 0.9, < 3, != 2.0.0) rspec (3.13.0) @@ -338,19 +347,19 @@ 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.1) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.13.0) - rubocop (1.60.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.64.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) @@ -358,40 +367,43 @@ GEM rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.30.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) rubocop-capybara (2.20.0) rubocop (~> 1.41) rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-rails (2.23.1) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-ast (>= 1.30.0, < 2.0) - rubocop-rspec (2.26.1) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (2.29.2) rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.3) + rubocop (~> 1.40) ruby-filemagic (0.7.3) - ruby-oembed (0.16.1) + ruby-oembed (0.17.0) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) rubyzip (2.3.2) - selenium-webdriver (4.17.0) + selenium-webdriver (4.21.1) base64 (~> 0.2) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - sentry-rails (5.16.1) + sentry-rails (5.17.3) railties (>= 5.0) - sentry-ruby (~> 5.16.1) - sentry-ruby (5.16.1) + sentry-ruby (~> 5.17.3) + sentry-ruby (5.17.3) + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) - shoulda-matchers (6.1.0) + shoulda-matchers (6.2.0) activesupport (>= 5.2.0) simplecov (0.22.0) docile (~> 1.1) @@ -399,8 +411,12 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - solid_queue (0.2.1) - rails (~> 7.1) + solid_queue (0.3.1) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (~> 1.2.2) + fugit (~> 1.10.1) + railties (>= 7.1) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -408,12 +424,14 @@ GEM actionpack (>= 5.2) activesupport (>= 5.2) sprockets (>= 3.0.0) - sshkit (1.22.0) + sshkit (1.22.2) + base64 mutex_m net-scp (>= 1.1.2) net-sftp (>= 2.1.2) net-ssh (>= 2.8.0) stringio (3.1.0) + strscan (3.1.0) sunspot (2.6.0) pr_geohash (~> 1.0) rsolr (>= 1.1.1, < 3) @@ -421,7 +439,7 @@ GEM rails (>= 3) sunspot (= 2.6.0) sunspot_solr (2.6.0) - terser (1.2.0) + terser (1.2.2) execjs (>= 0.3.0, < 3) thor (1.3.1) tilt (2.3.0) @@ -439,7 +457,7 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) - webmock (3.19.1) + webmock (3.23.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -450,7 +468,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.13) + zeitwerk (2.6.15) PLATFORMS ruby diff --git a/app/models/invite.rb b/app/models/invite.rb index 6553f2bb..cf13e4d6 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -19,8 +19,8 @@ class Invite < ApplicationRecord after_create :revoke_invite before_destroy :grant_invite - scope :active, -> { where("expires_at >= ?", Time.now.utc).includes(:user) } - scope :expired, -> { where("expires_at < ?", Time.now.utc) } + scope :active, -> { where(expires_at: Time.now.utc..).includes(:user) } + scope :expired, -> { where(expires_at: ...Time.now.utc) } class << self # Makes a unique random token. diff --git a/app/models/post.rb b/app/models/post.rb index 8b307399..c7980bf4 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -38,7 +38,7 @@ def me_post? end def post_number - @post_number ||= exchange.posts.where("id < ?", id).count + 1 + @post_number ||= exchange.posts.where(id: ...id).count + 1 end def page(options = {}) diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb index f4556db3..6d56e439 100644 --- a/config/initializers/application_controller_renderer.rb +++ b/config/initializers/application_controller_renderer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # ActiveSupport::Reloader.to_prepare do diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 5ec75645..4495bcea 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 6f0e68b4..b55a5ace 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Define an application-wide content security policy diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 6c78420e..9e049dcc 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb index 50bcf4ea..810aadeb 100644 --- a/config/initializers/permissions_policy.rb +++ b/config/initializers/permissions_policy.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + # Define an application-wide HTTP permissions policy. For further # information see https://developers.google.com/web/updates/2018/06/feature-policy #