mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 05:23:37 +08:00
Remove deprecated finder method calls
This commit is contained in:
parent
ec1ea18877
commit
b68dbe081c
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user