Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into bw/no-mixed-units/4579
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid committed Jan 5, 2025
2 parents 9109841 + 2584427 commit 1cbc4a8
Show file tree
Hide file tree
Showing 57 changed files with 214 additions and 173 deletions.
34 changes: 10 additions & 24 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ inherit_mode:

inherit_gem:
standard: config/base.yml
standard-rails: config/base.yml
standard-performance: config/base.yml

inherit_from:
.rubocop_todo.yml
Expand All @@ -12,15 +14,17 @@ require:
- rubocop-rails
- rubocop-performance
- standard
- standard-rails
- standard-performance

AllCops:
TargetRubyVersion: 3.1.2
Exclude:
- "vendor/**/*"
- "db/schema.rb"
- "db/partners_schema.rb"
- "db/seeds.rb"
- "db/migrate/*"
- "db/partners_migrate/*"
- "bin/*"
- "lib/files/cucumber.rake"
- "lib/tasks/*"
Expand All @@ -29,26 +33,13 @@ AllCops:
- "Rakefile"
- "tmp/*"
- "node_modules/**/*"
UseCache: false

Rails:
Enabled: true
Rails/Output:
Enabled: true
Rails/Date:
Enabled: true
Rails/FilePath:
Enabled: false
Rails/FindBy:
Enabled: true
Rails/FindEach:
Enabled: true
Rails/PluralizationGrammar:
Enabled: true
Rails/ScopeArgs:
Enabled: true
Rails/TimeZone:
Enabled: true
Rails/UnknownEnv:
Environments:
- production
Expand All @@ -62,32 +53,27 @@ Rails/AfterCommitOverride:
Enabled: false
Rails/FindById:
Enabled: false
Rails/Inquiry:
Enabled: false
Rails/MailerName:
Enabled: false
Rails/MatchRoute:
Enabled: false
Rails/NegateInclude:
Enabled: false
Rails/Pluck:
Enabled: false
Rails/PluckInWhere:
Enabled: false
Rails/RenderInline:
Enabled: false
Rails/RenderPlainText:
Enabled: false
Rails/ShortI18n:
Enabled: false
Rails/SquishedSQLHeredocs:
Enabled: false
Rails/WhereExists:
Enabled: false
Rails/WhereNot:
Enabled: false
Rails/HasAndBelongsToMany:
Enabled: false
Rails/ThreeStateBooleanColumn:
Enabled: true
# FIXME: Fix our ENV variable access and remove the following config.
Rails/EnvironmentVariableAccess:
AllowReads: true

Rails/BulkChangeTable:
Exclude:
Expand Down
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,16 @@ group :development, :test do
# Debugger which supports rdbg and Shopify Ruby LSP VSCode extension
gem "debug", ">= 1.0.0"
# RSpec behavioral testing framework for Rails.
gem "rspec-rails", "~> 7.0.1"
gem "rspec-rails", "~> 7.1.0"
# Static analysis / linter.
gem "rubocop"
# Rails add-on for static analysis.
gem 'rubocop-performance'
gem "rubocop-rails", "~> 2.27.0"
gem "rubocop-rails", "~> 2.25.1"
# Default rules for Rubocop.
gem "standard", "~> 1.40"
gem "standard-rails"
gem "standard-performance"
# Erb linter.
gem "erb_lint"
end
Expand Down Expand Up @@ -219,4 +221,4 @@ end
# Use Redis for Action Cable
gem "redis", "~> 5.3"

gem "importmap-rails", "~> 2.0"
gem "importmap-rails", "~> 2.1"
77 changes: 42 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ GEM
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (3.1.8)
bigdecimal (3.1.9)
bindex (0.8.1)
binding_of_caller (1.0.1)
debug_inspector (>= 1.2.0)
Expand Down Expand Up @@ -157,7 +157,7 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.4.0)
date (3.4.1)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
Expand Down Expand Up @@ -185,9 +185,9 @@ GEM
discard (1.3.0)
activerecord (>= 4.2, < 8)
docile (1.4.0)
dotenv (3.1.4)
dotenv-rails (3.1.4)
dotenv (= 3.1.4)
dotenv (3.1.7)
dotenv-rails (3.1.7)
dotenv (= 3.1.7)
railties (>= 6.1)
drb (2.2.1)
dry-core (1.0.1)
Expand Down Expand Up @@ -216,14 +216,14 @@ GEM
rainbow
rubocop (>= 1)
smart_properties
erubi (1.13.0)
erubi (1.13.1)
execjs (2.10.0)
factory_bot (6.5.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.4)
factory_bot (~> 6.5)
railties (>= 5.0.0)
faker (3.4.2)
faker (3.5.1)
i18n (>= 1.8.11, < 2)
faraday (1.10.4)
faraday-em_http (~> 1.0)
Expand Down Expand Up @@ -259,11 +259,11 @@ GEM
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
filterrific (5.2.5)
flipper (1.3.1)
flipper (1.3.2)
concurrent-ruby (< 2)
flipper-active_record (1.3.0)
activerecord (>= 4.2, < 8)
flipper (~> 1.3.0)
flipper-active_record (1.3.2)
activerecord (>= 4.2, < 9)
flipper (~> 1.3.2)
flipper-ui (1.3.1)
erubi (>= 1.0.0, < 2.0.0)
flipper (~> 1.3.1)
Expand Down Expand Up @@ -303,14 +303,15 @@ GEM
multi_xml (>= 0.5.2)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
icalendar (2.10.2)
icalendar (2.10.3)
ice_cube (~> 0.16)
ostruct
ice_cube (0.17.0)
ice_nine (0.11.2)
image_processing (1.13.0)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (2.0.3)
importmap-rails (2.1.0)
actionpack (>= 6.0.0)
activesupport (>= 6.0.0)
railties (>= 6.0.0)
Expand All @@ -336,7 +337,7 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
knapsack_pro (7.6.2)
knapsack_pro (7.13.1)
rake
language_server-protocol (3.17.0.3)
launchy (3.0.0)
Expand All @@ -348,13 +349,13 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.3)
logger (1.6.4)
lograge (0.14.0)
actionpack (>= 4)
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.23.1)
loofah (2.24.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lumberjack (1.2.9)
Expand Down Expand Up @@ -403,11 +404,11 @@ GEM
net-protocol
newrelic_rpm (9.16.0)
nio4r (2.7.4)
nokogiri (1.17.2-arm64-darwin)
nokogiri (1.18.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-darwin)
nokogiri (1.18.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
nokogiri (1.18.1-x86_64-linux-gnu)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -438,6 +439,7 @@ GEM
capybara (>= 1.1)
rspec (>= 2.14)
orm_adapter (0.5.0)
ostruct (0.6.1)
paper_trail (15.2.0)
activerecord (>= 6.1)
request_store (~> 1.4)
Expand All @@ -458,7 +460,7 @@ GEM
matrix (~> 0.4)
pdf-core (~> 0.10.0)
ttfunk (~> 1.8)
prawn-rails (1.5.0)
prawn-rails (1.6.0)
actionview (>= 3.1.0)
activesupport (>= 3.1.0)
prawn
Expand Down Expand Up @@ -494,9 +496,9 @@ GEM
rack (>= 3.0.0, < 4)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.0)
rackup (2.2.1)
rack (>= 3)
rails (7.2.2)
actioncable (= 7.2.2)
Expand Down Expand Up @@ -563,23 +565,23 @@ GEM
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.1)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.1)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (7.0.1)
rspec-rails (7.1.0)
actionpack (>= 7.0)
activesupport (>= 7.0)
railties (>= 7.0)
rspec-core (~> 3.13)
rspec-expectations (~> 3.13)
rspec-mocks (~> 3.13)
rspec-support (~> 3.13)
rspec-support (3.13.1)
rspec-support (3.13.2)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
Expand All @@ -595,10 +597,10 @@ GEM
rubocop-performance (1.23.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.27.0)
rubocop-rails (2.25.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-graphviz (1.2.5)
rexml
Expand Down Expand Up @@ -664,6 +666,9 @@ GEM
standard-performance (1.6.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.23.0)
standard-rails (1.1.0)
lint_roller (~> 1.0)
rubocop-rails (~> 2.25.0)
stimulus-rails (1.3.4)
railties (>= 6.0.0)
stringio (3.1.2)
Expand All @@ -673,10 +678,10 @@ GEM
execjs (>= 0.3.0, < 3)
thor (1.3.2)
tilt (2.2.0)
timeout (0.4.2)
timeout (0.4.3)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
turbo-rails (2.0.11)
turbo-rails (2.0.10)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
Expand All @@ -685,7 +690,7 @@ GEM
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uniform_notifier (1.16.0)
useragent (0.16.10)
useragent (0.16.11)
version_gem (1.1.4)
warden (1.2.9)
rack (>= 2.0.9)
Expand Down Expand Up @@ -757,7 +762,7 @@ DEPENDENCIES
httparty
icalendar
image_processing
importmap-rails (~> 2.0)
importmap-rails (~> 2.1)
jbuilder
jwt
kaminari
Expand Down Expand Up @@ -789,16 +794,18 @@ DEPENDENCIES
recaptcha
redis (~> 5.3)
rolify (~> 6.0)
rspec-rails (~> 7.0.1)
rspec-rails (~> 7.1.0)
rubocop
rubocop-performance
rubocop-rails (~> 2.27.0)
rubocop-rails (~> 2.25.1)
sass-rails
shoulda-matchers (~> 6.2)
simple_form
simplecov
sprockets (~> 4.2.1)
standard (~> 1.40)
standard-performance
standard-rails
stimulus-rails
strong_migrations (= 1.8.0)
terser
Expand All @@ -807,4 +814,4 @@ DEPENDENCIES
webmock (~> 3.24)

BUNDLED WITH
2.5.22
2.6.2
3 changes: 2 additions & 1 deletion app/controllers/distributions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def create
@distribution = result.distribution

perform_inventory_check
schedule_reminder_email(result.distribution) if @distribution.reminder_email_enabled

respond_to do |format|
format.turbo_stream do
Expand Down Expand Up @@ -196,7 +197,7 @@ def update
if result.resend_notification? && @distribution.partner&.send_reminders
send_notification(current_organization.id, @distribution.id, subject: "Your Distribution Has Changed", distribution_changes: result.distribution_content.changes)
end
schedule_reminder_email(@distribution)
schedule_reminder_email(@distribution) if @distribution.reminder_email_enabled

perform_inventory_check
redirect_to @distribution, notice: "Distribution updated!"
Expand Down
Loading

0 comments on commit 1cbc4a8

Please sign in to comment.