Currently getting `NoMethodError: undefined method...
# support
k
Currently getting `NoMethodError: undefined method
has_one_attached' for #<Class:0x0000556c9d23c800>
when trying to deploy with:
Copy code
if Rails.env.production?
    attachment_config = {
      s3_credentials: {
        bucket:            ENV["S3_BUCKET_NAME"],
        access_key_id:     ENV["AWS_ACCESS_KEY_ID"],
        secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"]
      },

      storage:        :s3,
      s3_headers:     { "Cache-Control" => "max-age=31557600" },
      s3_protocol:    "https",
      s3_region:      ENV["AWS_REGION"],
      bucket:         ENV["S3_BUCKET_NAME"],
      url:            ":s3_domain_url",

      styles: {
        mini:    "128x128>",
        small:   "256x256>",
        product: "512x512>",
        large:   "1024x1024>"
      },

      path:          "/:class/:id/:style/:basename.:extension",
      default_url:   "noimage/:style.png",
      default_style: "product",
    }

    attachment_config.each do |key, value|
      Spree::Image.attachment_definitions[:attachment][key.to_sym] = value
    end
end