From 1ab44a241927816839a2c6c29ac4e5f03c292de8 Mon Sep 17 00:00:00 2001 From: Caleb Corliss Date: Mon, 20 Oct 2014 14:42:44 -0400 Subject: [PATCH] Rails ActiveRecord 4 syntax update ActiveRecord#update_all was deprecated in Rails 2.3.8 and has since been replaced by ActiveRecord::Relation#update_all. With this change the method signature (accepted parameters) and usage have also changed requiring the refactoring. --- lib/technoweenie/attachment_fu/backends/db_file_backend.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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