diff --git a/lib/technoweenie/attachment_fu/backends/db_file_backend.rb b/lib/technoweenie/attachment_fu/backends/db_file_backend.rb index 23881e75..cf7f4e81 100644 --- a/lib/technoweenie/attachment_fu/backends/db_file_backend.rb +++ b/lib/technoweenie/attachment_fu/backends/db_file_backend.rb @@ -29,11 +29,12 @@ def save_to_storage if save_attachment? (db_file || build_db_file).data = temp_data db_file.save! - self.class.update_all ['db_file_id = ?', self.db_file_id = db_file.id], ['id = ?', id] + self.db_file_id = db_file.id + self.class.where(:id => id).update_all(:db_file_id => db_file.id) end true end end end end -end \ No newline at end of file +end