From 247db2136eba3ed7090adf23ff2377c9c9aefd29 Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Fri, 30 Sep 2016 17:07:25 -0600 Subject: [PATCH 1/2] Restore "Make last names optional on Spree::Address" This reverts commit 66abad46ede137a9c352f38291ffc894157ab3bd. --- core/app/models/spree/address.rb | 2 +- core/lib/spree/testing_support/factories/address_factory.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app/models/spree/address.rb b/core/app/models/spree/address.rb index c5b31172f46..490c25fecb1 100644 --- a/core/app/models/spree/address.rb +++ b/core/app/models/spree/address.rb @@ -11,7 +11,7 @@ class Address < Spree::Base belongs_to :country, class_name: "Spree::Country" belongs_to :state, class_name: "Spree::State" - validates :firstname, :lastname, :address1, :city, :country_id, presence: true + validates :firstname, :address1, :city, :country_id, presence: true validates :zipcode, presence: true, if: :require_zipcode? validates :phone, presence: true, if: :require_phone? diff --git a/core/lib/spree/testing_support/factories/address_factory.rb b/core/lib/spree/testing_support/factories/address_factory.rb index 775b3da6672..b80711e05d2 100644 --- a/core/lib/spree/testing_support/factories/address_factory.rb +++ b/core/lib/spree/testing_support/factories/address_factory.rb @@ -11,7 +11,7 @@ end firstname 'John' - lastname 'Doe' + lastname nil company 'Company' address1 '10 Lovely Street' address2 'Northwest' From 6f7f8e92cfa85e780890fe7c787aa35a590f336e Mon Sep 17 00:00:00 2001 From: Jordan Brough Date: Fri, 30 Sep 2016 17:15:36 -0600 Subject: [PATCH 2/2] Fix spec for removal of lastname This is nil now which converts into a string as a param. Testing last name specifically doesn't seem critical for the purpose of this spec. --- backend/spec/controllers/spree/admin/payments_controller_spec.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/spec/controllers/spree/admin/payments_controller_spec.rb b/backend/spec/controllers/spree/admin/payments_controller_spec.rb index 64718d42aea..dd592b5694c 100644 --- a/backend/spec/controllers/spree/admin/payments_controller_spec.rb +++ b/backend/spec/controllers/spree/admin/payments_controller_spec.rb @@ -54,7 +54,6 @@ module Admin let(:address_attributes) do { 'firstname' => address.firstname, - 'lastname' => address.lastname, 'address1' => address.address1, 'city' => address.city, 'country_id' => address.country_id,