Skip to content

Commit

Permalink
Rails 7.1 defaults
Browse files Browse the repository at this point in the history
This patch switches to Rails 7.1 new framework defaults.
  • Loading branch information
thibaudgg committed Nov 3, 2023
1 parent f896e9c commit 3956ebc
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 309 deletions.
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/rails/rails.git
revision: 0f21aeb3bfc3a1b23687fb90023600ce0f66fe13
revision: 8be97569325f99c4456b257a180a05c891665d7e
branch: 7-1-stable
specs:
actioncable (7.1.1)
Expand Down Expand Up @@ -123,8 +123,8 @@ GEM
ruby2_keywords (>= 0.0.2)
attr_extras (7.1.0)
aws-eventstream (1.2.0)
aws-partitions (1.843.0)
aws-sdk-core (3.185.1)
aws-partitions (1.844.0)
aws-sdk-core (3.186.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
Expand All @@ -142,7 +142,7 @@ GEM
bcrypt (3.1.19)
bigdecimal (3.1.4)
bindex (0.8.1)
bootsnap (1.16.0)
bootsnap (1.17.0)
msgpack (~> 1.2)
builder (3.2.4)
bullet (7.1.2)
Expand Down Expand Up @@ -234,7 +234,7 @@ GEM
i18n-backend-side_by_side (1.3.0)
activesupport (>= 6.0.0)
i18n (>= 1.10.0)
icalendar (2.9.0)
icalendar (2.10.0)
ice_cube (~> 0.16)
ice_cube (0.16.4)
image_processing (1.12.2)
Expand Down Expand Up @@ -307,7 +307,7 @@ GEM
msgpack (1.7.2)
multi_json (1.15.0)
mutex_m (0.1.2)
net-imap (0.4.2)
net-imap (0.4.3)
date
net-protocol
net-pop (0.1.2)
Expand Down Expand Up @@ -339,7 +339,7 @@ GEM
ruby-rc4
ttfunk
pg (1.4.6)
phony (2.20.9)
phony (2.20.10)
phony_rails (0.15.0)
activesupport (>= 3.0)
phony (>= 2.18.12)
Expand Down Expand Up @@ -368,7 +368,7 @@ GEM
puma (6.4.0)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.7.1)
racc (1.7.2)
rack (3.0.8)
rack-cors (2.0.1)
rack (>= 2.0.0)
Expand All @@ -391,7 +391,7 @@ GEM
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
rake (13.1.0)
ransack (4.1.0)
ransack (4.1.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
Expand Down Expand Up @@ -434,7 +434,7 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.1)
ruby-lsp (0.12.1)
ruby-lsp (0.12.2)
language_server-protocol (~> 3.17.0)
prism (>= 0.15.1, < 0.16)
sorbet-runtime (>= 0.5.5685)
Expand All @@ -460,7 +460,7 @@ GEM
sentry-sidekiq (5.12.0)
sentry-ruby (~> 5.12.0)
sidekiq (>= 3.0)
sidekiq (7.1.6)
sidekiq (7.2.0)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
rack (>= 2.2.4)
Expand All @@ -475,7 +475,7 @@ GEM
slim (5.1.1)
temple (~> 0.10.0)
tilt (>= 2.1.0)
sorbet-runtime (0.5.11104)
sorbet-runtime (0.5.11114)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down
2 changes: 1 addition & 1 deletion app/models/absence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class Absence < ApplicationRecord
}, unless: :admin
validate :good_period_range

after_commit :update_memberships!
after_create_commit :notify_admins!
after_commit :update_memberships!

scope :past, -> { where('ended_on < ?', Time.current) }
scope :future, -> { where('started_on > ?', Time.current) }
Expand Down
3 changes: 2 additions & 1 deletion app/models/delivery.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ class Delivery < ApplicationRecord
unless: :date?,
on: :create

after_commit :reset_deliveries_cycle_cache!
after_commit :update_baskets_async
after_commit -> { self.class.update_numbers(fiscal_year) }
after_commit :update_baskets_async, :reset_deliveries_cycle_cache!

def self.next
coming.order(:date).first
Expand Down
4 changes: 2 additions & 2 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class Invoice < ApplicationRecord
on: :create,
if: :membership_type?

after_commit :enqueue_processing, on: :create
after_commit :update_membership_activity_participations_accepted!
after_destroy -> { Billing::PaymentsRedistributor.redistribute!(member_id) }
after_commit :update_membership_activity_participations_accepted!
after_commit :enqueue_processing, on: :create

def self.entity_types
types = %w[Membership Other]
Expand Down
6 changes: 3 additions & 3 deletions app/models/membership.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ class Membership < ApplicationRecord
after_update :handle_started_on_change!
after_update :handle_ended_on_change!
after_update :handle_config_change!
after_commit :update_member_and_baskets!, :update_activity_participations_demanded!, :cancel_outdated_invoice!
after_commit :update_price_and_invoices_amount!, on: %i[create update]
after_commit :update_renewal_of_previous_membership_after_creation, on: :create
after_destroy :update_renewal_of_previous_membership_after_deletion, :destroy_or_cancel_invoices!
after_commit :update_renewal_of_previous_membership_after_creation, on: :create
after_commit :update_price_and_invoices_amount!, on: %i[create update]
after_commit :update_member_and_baskets!, :update_activity_participations_demanded!, :cancel_outdated_invoice!

scope :started, -> { where('started_on < ?', Time.current) }
scope :past, -> { where('ended_on < ?', Time.current) }
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module ACPAdmin
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
config.load_defaults 7.1

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
Expand Down
8 changes: 2 additions & 6 deletions config/initializers/mail_delivery_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
require 'current_context'

module ActionMailer
class MailDeliveryJob < ActiveJob::Base
include CurrentContext
end
Rails.application.config.after_initialize do
ActionMailer::MailDeliveryJob.send(:include, CurrentContext)
end
Loading

0 comments on commit 3956ebc

Please sign in to comment.