ありふれたペーパー クリップのようなコードがあります。
has_merchants_attached_file :pdf,
storage: :s3,
s3_credentials: Mbc::DataStore.s3_credentials,
s3_permissions: :private,
path: ":identifier_template.pdf",
bucket: Mbc::DataStore.forms_and_templates_bucket_name
validates_attachment_file_name :pdf, :matches => [/pdf\Z/]
エラーが発生します:
undefined method `validates_attachment_file_name' for #<Class:0x007fba67d25fe0>
興味深いことに、グレードを 3.5 に戻すと、同じ問題が発生します。
これを生成しているコントローラーは次のとおりです。
def index
@fidelity_templates = FidelityTemplate.order("identifier asc").all
end
さらに:
def has_merchants_attached_file(attribute, options={})
if Rails.env.test? || Rails.env.development?
has_attached_file attribute,
path: "paperclip_attachments/#{options[:path]}"
else
has_attached_file attribute, options
end
end
これを引き起こしている可能性のあるものについて何か考えはありますか?