{"record":{"id":"01b8a55ef32c104d","repo":"spree/spree","slug":"name-is-deprecated-and-will-be-removed-in-spree-6-01b8a5","errorCode":null,"errorMessage":"#name is deprecated and will be removed in Spree 6.1. Use #label instead.","messagePattern":"#name is deprecated and will be removed in Spree 6\\.1\\. Use #label instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spree/core/app/models/spree/custom_field_definition.rb","lineNumber":83,"sourceCode":"      # have no token. Anything else gets surfaced as an error on `field_type`\n      # so API clients get a token-vocabulary message instead of a raw\n      # class-name inclusion error.\n      @field_type_input_recognized = !mapped.nil? || valid_available_types.include?(string_value)\n      super(mapped || value)\n    end\n\n    # The raw STI class name stored in the column, as opposed to the API token\n    # returned by {#field_type}.\n    # @return [String]\n    def field_type_class_name\n      self[:field_type]\n    end\n\n    #\n    # Deprecated 6.0 column names, removed in 6.1\n    #\n    def name\n      Spree::Deprecation.warn('#name is deprecated and will be removed in Spree 6.1. Use #label instead.')\n      label\n    end\n\n    def name=(value)\n      Spree::Deprecation.warn('#name= is deprecated and will be removed in Spree 6.1. Use #label= instead.')\n      self.label = value\n    end\n\n    def metafield_type\n      Spree::Deprecation.warn('#metafield_type is deprecated and will be removed in Spree 6.1. Use #field_type (which returns an API token) or #field_type_class_name instead.')\n      field_type_class_name\n    end\n\n    def metafield_type=(value)\n      Spree::Deprecation.warn('#metafield_type= is deprecated and will be removed in Spree 6.1. Use #field_type= instead.')\n      self.field_type = value\n    end\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/spree/spree/blob/06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2/spree/core/app/models/spree/custom_field_definition.rb#L65-L101","documentation":"Spree 6.0 renamed the Metafields system to Custom Fields, and the definition's name column became label. Spree::CustomFieldDefinition#name is now a deprecation shell: it emits this warning via Spree::Deprecation.warn and forwards to label (the writer name= forwards to label=). Both shells are deleted in Spree 6.1, after which the call fails.","triggerScenarios":"Calling definition.name or definition.name = 'Size' on a Spree::CustomFieldDefinition — extension code, custom dashboards, rake tasks, imports or serializers written against the pre-6.0 Metafields API that display or search definitions by name.","commonSituations":"Upgrading a Spree 5.x app or extension that managed metafield definitions; CSV export/report code still keyed on .name; copy-pasted metafields samples. Usually shows up as repeated log noise during test runs after bumping to Spree 6.0.","solutions":["Rename all reads to definition.label and all writes to definition.label=.","Grep for the sibling shells on the same model: .metafield_type and .metafield_type= — they are deprecated in the same block and removed together.","Run the suite with Spree::Deprecation.behavior = :raise so remaining call sites fail loudly instead of only logging.","Before upgrading to Spree 6.1, update or drop third-party gems that still call the pre-6.0 Metafields API."],"exampleFix":"# before\ndefinition.name = 'Size'\n\n# after\ndefinition.label = 'Size'","handlingStrategy":"validation","validationCode":"# spec/spec_helper.rb — turn any deprecated Spree call into a failing spec\nSpree::Deprecation.behavior = :raise","typeGuard":"# Cross-version helper: prefer the 6.0 name when present\ndefinition.respond_to?(:label) ? definition.label : definition.name","tryCatchPattern":null,"preventionTips":["Run CI with Spree::Deprecation.behavior = :raise so deprecated calls fail the build instead of only logging.","Before upgrading Spree, grep for the old vocabulary: rg \"metafield\" app lib config.","Keep the Spree 6.1 upgrade notes open during a 6.0 upgrade — every shell that warns today is deleted then."],"tags":["spree","deprecation","ruby","custom-fields","rename"],"backgroundTag":"deprecated-api-usage","analyzedSha":"06bf66a8684b9de03210bbb2ddc8c1f5ba522fa2","analyzedAt":"2026-08-21T14:59:48.125Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}