问题
I am wondering if Paperclip does require all four columns in database as:
add_column :users, :avatar_file_name, :string
add_column :users, :avatar_content_type, :string
add_column :users, :avatar_file_size, :integer
add_column :users, :avatar_updated_at, :datetime
Can I just add the avatar_file_name? And not add the other 3 columns?
It is because I wont to use paperclip instead of the filecolumn gem. And it uses only 1 column therefor I don´t want fill out all columns that paperclip support.
回答1:
I'm pretty sure you could just add one column + 3 attr_accessor
playing a dummy role.
But this looks awkward and I wouldn't advise to do so.
来源:https://stackoverflow.com/questions/7475947/does-paperclip-require-all-4-columns-file-name-content-type-etc