我们有看起来像磨坊回形针运行的代码:
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
关于可能导致这种情况的任何想法?