Skip to content

Commit

Permalink
Merge pull request technoweenie#9 from corlissc/master
Browse files Browse the repository at this point in the history
Refactor DbFileBackend for Rails 4 AREL conformity
  • Loading branch information
pothoven committed Sep 23, 2014
2 parents 8b6c7be + 613b74d commit 63665cc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/technoweenie/attachment_fu/backends/db_file_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
end

0 comments on commit 63665cc

Please sign in to comment.