Skip to content

Commit

Permalink
don't default type_2 if indicator_2 is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
jambun committed Aug 31, 2017
1 parent d7dad13 commit 4d18c63
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions backend/converters/obsolete_carriers_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,20 @@ def format_instance_type(type)
def format_instance(row)
return unless row['container_type'] && row['container_indicator']

sub = {
:top_container => {
:ref => get_or_create_top_container(row)
}
}

if row['container_barcode']
sub[:type_2] = 'object'
sub[:indicator_2] = row['container_barcode']
end

{
:instance_type => format_instance_type(row['instance_type']),
:sub_container => {
:type_2 => 'object',
:indicator_2 => row['container_barcode'],
:top_container => {
:ref => get_or_create_top_container(row)
}
}
:sub_container => sub
}
end

Expand Down

0 comments on commit 4d18c63

Please sign in to comment.