spree/spree · error

#{self.class}#user is deprecated and will be removed in Spre

Error message

#{self.class}#user is deprecated and will be removed in Spree 6.1. Use #customer instead.

What it means

Error "#{self.class}#user is deprecated and will be removed in Spree 6.1. Use #customer instead." thrown in spree/spree.

Source

Thrown at spree/core/app/models/concerns/spree/deprecated_customer_alias.rb:13

module Spree
  # Deprecation shim for the 6.0 user_id -> customer_id / belongs_to :user -> :customer
  # rename. Included by customer-facing models so `.user` / `.user_id` keep working
  # for one release. Remove in Spree 6.1.
  module DeprecatedCustomerAlias
    extend ActiveSupport::Concern

    included do
      alias_attribute :user_id, :customer_id
    end

    def user
      Spree::Deprecation.warn("#{self.class}#user is deprecated and will be removed in Spree 6.1. Use #customer instead.") if defined?(Spree::Deprecation)
      customer
    end

    def user=(value)
      Spree::Deprecation.warn("#{self.class}#user= is deprecated and will be removed in Spree 6.1. Use #customer= instead.") if defined?(Spree::Deprecation)
      self.customer = value
    end
  end
end

View on GitHub (pinned to 06bf66a868)

When it happens

Trigger: Thrown at spree/core/app/models/concerns/spree/deprecated_customer_alias.rb:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of spree/spree@06bf66a868 (2026-08-21). Data as JSON: /api/errors/d65b800f1bb53b36. Report an issue: GitHub.