app/models/solidus_braintree/address.rb in solidus_braintree-3.1.0 vs app/models/solidus_braintree/address.rb in solidus_braintree-3.2.0
- old
+ new
@@ -10,15 +10,11 @@
:state,
:zipcode,
to: :spree_address
def self.split_name(name)
- if defined?(Spree::Address::Name)
- address_name = Spree::Address::Name.new(name)
- [address_name.first_name, address_name.last_name]
- else
- name.strip.split(' ', 2)
- end
+ address_name = Spree::Address::Name.new(name)
+ [address_name.first_name, address_name.last_name].compact
end
def initialize(spree_address)
@spree_address = spree_address
end