Skip to content

Commit

Permalink
fix enum deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-mcneil committed Dec 9, 2024
1 parent ee78e47 commit 6b9d74c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
6 changes: 1 addition & 5 deletions app/models/accredited_individual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ class AccreditedIndividual < ApplicationRecord
validates :poa_code, length: { is: 3 }, allow_blank: true
validates :individual_type, uniqueness: { scope: :registration_number }

enum individual_type: {
'attorney' => 'attorney',
'claims_agent' => 'claims_agent',
'representative' => 'representative'
}
enum :individual_type, %i[attorney claims_agent representative]

DEFAULT_FUZZY_THRESHOLD = AccreditedRepresentation::Constants::FUZZY_SEARCH_THRESHOLD

Expand Down
5 changes: 3 additions & 2 deletions app/models/form526_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ class Form526Submission < ApplicationRecord
belongs_to :user_account, dependent: nil, optional: true

validates(:auth_headers_json, presence: true)
enum backup_submitted_claim_status: { accepted: 0, rejected: 1, paranoid_success: 2 }
enum submit_endpoint: { evss: 0, claims_api: 1, benefits_intake_api: 2 }

enum :backup_submitted_claim_status, %i[accepted rejected paranoid_success]
enum :submit_endpoint, %i[evss claims_api benefits_intake_api]

FORM_526 = 'form526'
FORM_526_UPLOADS = 'form526_uploads'
Expand Down
2 changes: 1 addition & 1 deletion app/models/form526_submission_remediation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Form526SubmissionRemediation < ApplicationRecord

before_create :initialize_lifecycle

enum remediation_type: { manual: 0, ignored_as_duplicate: 1, email_notified: 2 }
enum :remediation_type, %i[manual ignored_as_duplicate email_notified]

STATSD_KEY_PREFIX = 'form526_submission_remediation'

Expand Down
3 changes: 2 additions & 1 deletion app/models/terms_of_use_agreement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class TermsOfUseAgreement < ApplicationRecord
belongs_to :user_account

validates :agreement_version, :response, presence: true
enum response: { declined: 0, accepted: 1 }

enum :response, %i[declined accepted]

default_scope { order(created_at: :asc) }
scope :current, -> { where(agreement_version: CURRENT_VERSION) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RepresentationManagement
class FlaggedVeteranRepresentativeContactData < ApplicationRecord
self.table_name = 'flagged_veteran_representative_contact_data'

enum flag_type: { phone_number: 'phone_number', email: 'email', address: 'address', other: 'other' }, _suffix: true
enum :flag_type, %i[phone_number email address other], suffix: true
validates :ip_address, :representative_id, :flag_type, :flagged_value, presence: true
validates :ip_address,
uniqueness: { scope: %i[representative_id flag_type flagged_value_updated_at], message: 'Combination of ip_address, representative_id, flag_type, and flagged_value_updated_at must be unique' } # rubocop:disable Rails/I18nLocaleTexts,Layout/LineLength
Expand Down

0 comments on commit 6b9d74c

Please sign in to comment.