Skip to content

Commit

Permalink
Merge pull request #1685 from solidusio/revert-1680-deprecate_address…
Browse files Browse the repository at this point in the history
…_empty

Revert "Deprecate Spree::Address#empty?"
  • Loading branch information
jhawthorn authored Jan 16, 2017
2 parents 1b2b623 + 3341542 commit 1420aaa
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions core/app/models/spree/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,19 @@ def ==(other_address)
end

def same_as?(other_address)
Spree::Deprecation.warn("Address#same_as? is deprecated. It's equivalent to Address.==", caller)
Spree::Deprecation.warn("Address.same_as? is deprecated. It's equivalent to Address.==", caller)
self == other_address
end

def same_as(other_address)
Spree::Deprecation.warn("Address#same_as is deprecated. It's equivalent to Address.==", caller)
Spree::Deprecation.warn("Address.same_as is deprecated. It's equivalent to Address.==", caller)
self == other_address
end

# @deprecated Do not use this
def empty?
Spree::Deprecation.warn("Address#empty? is deprecated.", caller)
attributes.except('id', 'created_at', 'updated_at', 'country_id').all? { |_, v| v.nil? }
end

# This exists because the default Object#blank?, checks empty? if it is
# defined, and we have defined empty.
# This should be removed once empty? is removed
def blank?
false
end

# @return [Hash] an ActiveMerchant compatible address hash
def active_merchant_hash
{
Expand Down

0 comments on commit 1420aaa

Please sign in to comment.