lib/physical/location.rb in physical-0.4.3 vs lib/physical/location.rb in physical-0.4.4
- old
+ new
@@ -79,13 +79,13 @@
@address_type == 'po_box'
end
def to_hash
{
- country: country.code,
+ country: country&.code,
postal_code: zip,
- region: region.code,
+ region: region&.code,
city: city,
name: name,
address1: address1,
address2: address2,
address3: address3,
@@ -96,9 +96,10 @@
company_name: company_name
}
end
def ==(other)
- to_hash == other.to_hash
+ other.is_a?(self.class) &&
+ to_hash == other&.to_hash
end
end
end