Refactor update_all statements in order to prevent deprecation warnings in Rails 4

This commit is contained in:
Stephan Kaag
2013-07-01 20:45:52 +02:00
parent 5770879472
commit 89b621d31a
18 changed files with 45 additions and 50 deletions

View File

@@ -39,7 +39,7 @@ module Trashable
#
# Fixed in Rails 4
#
self.class.unscoped.update_all({deleted_at: nil}, id: self.id)
self.class.unscoped.where(id: self.id).update_all({deleted_at: nil})
raw_write_attribute :deleted_at, nil
end