Skip to content

Commit

Permalink
Add type keyword argument to serialize
Browse files Browse the repository at this point in the history
Fix for deprecation warning:

> DEPRECATION WARNING: Passing the class as positional argument is deprecated and will be removed in Rails 7.2.
  • Loading branch information
jrmhaig committed Sep 6, 2024
1 parent 8dd8d99 commit fcc615d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/claim/base_claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BaseClaim < ApplicationRecord

auto_strip_attributes :case_number, :cms_number, :supplier_number, squish: true, nullify: true

serialize :evidence_checklist_ids, Array
serialize :evidence_checklist_ids, type: Array

attr_reader :form_step
alias current_step form_step
Expand Down
2 changes: 1 addition & 1 deletion app/models/claim_state_transition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ClaimStateTransition < ApplicationRecord
belongs_to :author, class_name: 'User'
belongs_to :subject, class_name: 'User'

serialize :reason_code, Array
serialize :reason_code, type: Array
alias_attribute :reason_codes, :reason_code

def reason
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Roles

included do |klass|
klass.extend(ClassMethods)
klass.serialize :roles, Array
klass.serialize :roles, type: Array
klass.before_validation :strip_empty_role
klass.validate :roles_valid

Expand Down

0 comments on commit fcc615d

Please sign in to comment.