Skip to content

Commit 737c70d

Browse files
authored
Merge pull request #1476 from MITLibraries/etd-667-71defaults
Rails 7.1 framework defaults
2 parents d8fbf03 + c0d9f10 commit 737c70d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: 2.7
2+
TargetRubyVersion: 3.2
33
NewCops: enable
44
StyleGuideBaseURL: https://rubystyle.guide
55
Exclude:

app/models/transfer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ def unassigned_files
9292

9393
# This ensures that the activestorage objects are actually available before we update the initial files counts.
9494
# The files are not available until the after_create_commit callback so our before_save callback does not work
95-
# for initial Transfer creation. This does mean we calculate the counts twice on creation (once with the count as
96-
# always zero, then the initial commit, then during the after_create_commit we re-save which counts them properly).
95+
# for initial Transfer creation. We use `update_columns` here to avoid triggering another before_save callback
96+
# for updating the files_count and unassigned_files_count.
9797
def initial_files_count
98-
save
98+
update_columns(unassigned_files_count: files.count)
9999
end
100100

101101
# This is triggered on before_save, but we must also remember to call Transfer#save to trigger this

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Application < Rails::Application
1717
config.flipflop.raise_strategy_errors = nil
1818

1919
# Initialize configuration defaults for originally generated Rails version.
20-
config.load_defaults 7.0
20+
config.load_defaults 7.1
2121

2222
# Please, add to the `ignore` list any other `lib` subdirectories that do
2323
# not contain `.rb` files, or that should not be reloaded or eager loaded.

0 commit comments

Comments
 (0)