Hi Everyone,
I am using the Paperclip plugin to manage file uploads to my application. For some reason in the last day or so the plugin/model has stopped working and now returns the following error message:
Paperclip::PaperclipError in DeliversController#create
Asset model missing required attr_accessor for 'data_file_name'
As far as I am aware, I haven't touched the delivers controller or the paperclip plugin.
Has anyone seen this error before, or know how I can trace the last change on the file thats error'ing?
For reference the db schema is as follows:
# Create Delivers Table
create_table :delivers do |t|
t.column :caseref, :string
t.column :casesubject, :string
t.column :description, :text
t.column :document_file_name, :string
t.column :document_content_type, :string
t.column :document_file_size, :integer
t.column :document_updated_at, :datetime
t.timestamps
end
# Create Assets Table
create_table :assets do |t|
t.column :attachable_id, :integer
t.column :attachable_type, :string
t.column :date_file_name, :string
t.column :date_content_type, :string
t.column :date_file_size, :integer
t.column :attachings_count, :integer, :default => 0
t.column :created_at, :datetime
t.column :date_updated_at, :datetime
t.timestamps
end
and the asset model is as follows:
class Asset < ActiveRecord::Base
has_attached_file :data,
:url => "/assets/:id",
:path => ":rails_root/assets/docs/:id/:style/:basename.:extension"
belongs_to :attachable, :polymorphic => true
def url(*args)
data.url(*args)
end
def name
data_file_name
end
def content_type
data_content_type
end
def file_size
data_file_size
end
end
Thanks,
Danny