Merge pull request #2199 from chancancode/fix_deprecated_finder_methods

Remove deprecated finder method calls
This commit is contained in:
Sam 2014-03-27 20:14:30 +11:00
commit fe80e02b75
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