Browse Source

refactor: write 'duplicate' instead of 'duplicity'

pull/1334/head
Sam Seed 3 years ago committed by Phil Lee
parent
commit
1906359dca
  1. 4
      app/services/bulk_upload/lettings/year2022/row_parser.rb
  2. 4
      app/services/bulk_upload/lettings/year2023/row_parser.rb
  3. 2
      spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb
  4. 2
      spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

4
app/services/bulk_upload/lettings/year2022/row_parser.rb

@ -394,7 +394,7 @@ class BulkUpload::Lettings::Year2022::RowParser
end
def log_already_exists?
LettingsLog.exists?(duplicity_check_fields.index_with { |field| log.public_send(field) })
LettingsLog.exists?(duplicate_check_fields.index_with { |field| log.public_send(field) })
end
private
@ -441,7 +441,7 @@ private
@created_by ||= User.find_by(email: field_112)
end
def duplicity_check_fields
def duplicate_check_fields
%w[
startdate
age1

4
app/services/bulk_upload/lettings/year2023/row_parser.rb

@ -399,7 +399,7 @@ class BulkUpload::Lettings::Year2023::RowParser
end
def log_already_exists?
LettingsLog.exists?(duplicity_check_fields.index_with { |field| log.public_send(field) })
LettingsLog.exists?(duplicate_check_fields.index_with { |field| log.public_send(field) })
end
private
@ -452,7 +452,7 @@ private
end
end
def duplicity_check_fields
def duplicate_check_fields
%w[
startdate
age1

2
spec/services/bulk_upload/lettings/year2022/row_parser_spec.rb

@ -226,7 +226,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
expect(parser).not_to be_valid
end
it "adds an error to all (and only) the fields used to determine duplicity" do
it "adds an error to all (and only) the fields used to determine duplicates" do
parser.valid?
error_message = "This is a duplicate log"

2
spec/services/bulk_upload/lettings/year2023/row_parser_spec.rb

@ -246,7 +246,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser).not_to be_valid
end
it "adds an error to all (and only) the fields used to determine duplicity" do
it "adds an error to all (and only) the fields used to determine duplicates" do
parser.valid?
error_message = "This is a duplicate log"

Loading…
Cancel
Save