Skip to content

Commit

Permalink
[ART] lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nihil2501 authored and ojbucao committed Jan 10, 2025
1 parent 125ed6c commit 3e4e6a7
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
3 changes: 2 additions & 1 deletion app/models/accredited_individual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class AccreditedIndividual < ApplicationRecord
has_many :power_of_attorney_requests,
as: :power_of_attorney_holder,
inverse_of: :power_of_attorney_holder,
class_name: 'AccreditedRepresentativePortal::PowerOfAttorneyRequest'
class_name: 'AccreditedRepresentativePortal::PowerOfAttorneyRequest',
dependent: :restrict_with_exception

validates :ogc_id, :registration_number, :individual_type, presence: true
validates :poa_code, length: { is: 3 }, allow_blank: true
Expand Down
3 changes: 2 additions & 1 deletion app/models/accredited_organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class AccreditedOrganization < ApplicationRecord
has_many :power_of_attorney_requests,
as: :power_of_attorney_holder,
inverse_of: :power_of_attorney_holder,
class_name: 'AccreditedRepresentativePortal::PowerOfAttorneyRequest'
class_name: 'AccreditedRepresentativePortal::PowerOfAttorneyRequest',
dependent: :restrict_with_exception

validates :ogc_id, :poa_code, presence: true
validates :poa_code, length: { is: 3 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AccreditedIndividualSerializer < ApplicationSerializer
poa_holder.last_name
]

parts.reject(&:blank?).join(' ')
parts.compact_blank.join(' ')
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PowerOfAttorneyHolderSerializer < ApplicationSerializer
poa_holder.last_name
]

parts.reject(&:blank?).join(' ')
parts.compact_blank.join(' ')
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
association :claimant, factory: :user_account
association :power_of_attorney_form, strategy: :build

association :power_of_attorney_holder, factory: [:accredited_organization, :with_representatives]
association :power_of_attorney_holder, factory: %i[accredited_organization with_representatives]
accredited_individual { power_of_attorney_holder.accredited_individuals.first }

trait :with_acceptance do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@
},
'accredited_individual' => {
'id' => poa_requests[0].accredited_individual.id,
'full_name' => "#{poa_requests[0].accredited_individual.first_name} #{poa_requests[0].accredited_individual.last_name}",
'full_name' => [
poa_requests[0].accredited_individual.first_name,
poa_requests[0].accredited_individual.last_name
].join(' ')
},
'resolution' => nil
},
Expand Down Expand Up @@ -161,7 +164,10 @@
},
'accredited_individual' => {
'id' => poa_requests[1].accredited_individual.id,
'full_name' => "#{poa_requests[1].accredited_individual.first_name} #{poa_requests[1].accredited_individual.last_name}",
'full_name' => [
poa_requests[1].accredited_individual.first_name,
poa_requests[1].accredited_individual.last_name
].join(' ')
},
'resolution' => {
'id' => poa_requests[1].resolution.id,
Expand Down Expand Up @@ -233,7 +239,10 @@
},
'accredited_individual' => {
'id' => poa_requests[2].accredited_individual.id,
'full_name' => "#{poa_requests[2].accredited_individual.first_name} #{poa_requests[2].accredited_individual.last_name}",
'full_name' => [
poa_requests[2].accredited_individual.first_name,
poa_requests[2].accredited_individual.last_name
].join(' ')
},
'resolution' => {
'id' => poa_requests[2].resolution.id,
Expand Down Expand Up @@ -306,7 +315,10 @@
},
'accredited_individual' => {
'id' => poa_requests[3].accredited_individual.id,
'full_name' => "#{poa_requests[3].accredited_individual.first_name} #{poa_requests[3].accredited_individual.last_name}",
'full_name' => [
poa_requests[3].accredited_individual.first_name,
poa_requests[3].accredited_individual.last_name
].join(' ')
},
'resolution' => {
'id' => poa_requests[3].resolution.id,
Expand Down Expand Up @@ -397,7 +409,10 @@
},
'accredited_individual' => {
'id' => poa_request.accredited_individual.id,
'full_name' => "#{poa_request.accredited_individual.first_name} #{poa_request.accredited_individual.last_name}",
'full_name' => [
poa_request.accredited_individual.first_name,
poa_request.accredited_individual.last_name
].join(' ')
}
}
)
Expand Down

0 comments on commit 3e4e6a7

Please sign in to comment.