Remove deprecated finder method calls

This commit is contained in:
Godfrey Chan 2014-03-27 00:00:23 -07:00
parent ec1ea18877
commit b68dbe081c
2 changed files with 3 additions and 3 deletions

View File

@ -193,7 +193,7 @@ class Group < ActiveRecord::Base
deletions = Set.new(deletions.map{|d| map[d]})
@deletions = []
group_users.delete_if do |gu|
group_users.each do |gu|
@deletions << gu if deletions.include?(gu.user_id)
end
@ -221,7 +221,7 @@ class Group < ActiveRecord::Base
if @deletions
@deletions.each do |gu|
gu.destroy
User.update_all 'primary_group_id = NULL', ['id = ? AND primary_group_id = ?', gu.user_id, gu.group_id]
User.where('id = ? AND primary_group_id = ?', gu.user_id, gu.group_id).update_all 'primary_group_id = NULL'
end
end
@deletions = nil

View File

@ -200,7 +200,7 @@ class Topic < ActiveRecord::Base
modifications: changes.extract!(:category_id, :title)
)
Post.update_all({version: number}, id: first_post_id)
Post.where(id: first_post_id).update_all(version: number)
end
end