Skip to content

Commit

Permalink
added checks for the *_content_type, *_file_size and *_updated_at col…
Browse files Browse the repository at this point in the history
…umns
  • Loading branch information
Mick Staugaard committed Nov 30, 2008
1 parent 93f4f3c commit 8fd00d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/attachment.rb
Expand Up @@ -54,7 +54,7 @@ def initialize name, instance, options = {}
# In addition to form uploads, you can also assign another Paperclip attachment:
# new_user.avatar = old_user.avatar
def assign uploaded_file
%w(file_name).each do |field|
%w(file_name content_type file_size updated_at).each do |field|
unless @instance.class.column_names.include?("#{name}_#{field}")
raise PaperclipError.new("#{@instance.class} model does not have required column '#{name}_#{field}'")
end
Expand Down

0 comments on commit 8fd00d2

Please sign in to comment.