Skip to content

Commit 3050291

Browse files
committed
fixes and updates for Rails 7.2
1 parent 7b202d3 commit 3050291

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ GEM
346346
listen (3.9.0)
347347
rb-fsevent (~> 0.10, >= 0.10.3)
348348
rb-inotify (~> 0.9, >= 0.9.10)
349-
logger (1.6.0)
349+
logger (1.6.1)
350350
lograge (0.14.0)
351351
actionpack (>= 4)
352352
activesupport (>= 4)
@@ -435,7 +435,7 @@ GEM
435435
capybara (>= 1.1)
436436
rspec (>= 2.14)
437437
orm_adapter (0.5.0)
438-
paper_trail (15.1.0)
438+
paper_trail (15.2.0)
439439
activerecord (>= 6.1)
440440
request_store (~> 1.4)
441441
parallel (1.26.3)
@@ -545,7 +545,7 @@ GEM
545545
regexp_parser (2.9.2)
546546
reline (0.5.10)
547547
io-console (~> 0.5)
548-
request_store (1.5.1)
548+
request_store (1.7.0)
549549
rack (>= 1.4)
550550
responders (3.1.1)
551551
actionpack (>= 5.2)

app/models/barcode_item.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ class BarcodeItem < ApplicationRecord
4949

5050
scope :global, -> { where(barcodeable_type: "BaseItem") }
5151

52-
alias_attribute :item, :barcodeable
53-
alias_attribute :base_item, :barcodeable
52+
# aliases of barcodeable
53+
belongs_to :item, polymorphic: true, dependent: :destroy,
54+
counter_cache: :barcode_count, foreign_key: :barcodeable_id, foreign_type: :barcodeable_type
55+
belongs_to :base_item, polymorphic: true, dependent: :destroy,
56+
counter_cache: :barcode_count, foreign_key: :barcodeable_id, foreign_type: :barcodeable_type
5457

5558
def to_h
5659
{

app/models/transfer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class Transfer < ApplicationRecord
2020
include Itemizable
2121
include Filterable
2222
include Exportable
23-
alias_attribute :storage_location, :from # to make it play nice with Itemizable
23+
# to make it play nice with Itemizable - alias of `from`
24+
belongs_to :storage_location, class_name: "StorageLocation", inverse_of: :transfers_from, foreign_key: :from_id
2425
scope :from_location, ->(location_id) { where(from_id: location_id) }
2526
scope :to_location, ->(location_id) { where(to_id: location_id) }
2627
scope :for_csv_export, ->(organization, *) {

config/environments/development.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
config.action_mailer.perform_caching = false
4949

50-
config.action_mailer.preview_path = "#{Rails.root}/lib/previews"
50+
config.action_mailer.preview_paths << "#{Rails.root}/lib/previews"
5151

5252
# Print deprecation notices to the Rails logger.
5353
config.active_support.deprecation = :log

0 commit comments

Comments
 (0)