From 66abad46ede137a9c352f38291ffc894157ab3bd Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Fri, 30 Sep 2016 14:26:21 -0700 Subject: [PATCH] Revert "Make last names optional on Spree::Address" This reverts commit 7fe6670d07b2ba4e9b40768ada9fca94a398a870. --- 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 490c25fecb1..c5b31172f46 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, :address1, :city, :country_id, presence: true + validates :firstname, :lastname, :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 b80711e05d2..775b3da6672 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 nil + lastname 'Doe' company 'Company' address1 '10 Lovely Street' address2 'Northwest'