rails 4 deprecation fixes

This commit is contained in:
Sam
2013-10-24 13:02:25 +11:00
parent 6fac09aeaa
commit ff957a7b37
3 changed files with 3 additions and 5 deletions

View File

@ -112,9 +112,9 @@ class PostCreator
def track_latest_on_category
if @post && @post.errors.count == 0 && @topic && @topic.category_id
Category.update_all( {latest_post_id: @post.id}, {id: @topic.category_id} )
Category.where(id: @topic.category_id).update_all(latest_post_id: @post.id)
if @post.post_number == 1
Category.update_all( {latest_topic_id: @topic.id}, {id: @topic.category_id} )
Category.where(id: @topic.category_id).update_all(latest_topic_id: @topic.id)
end
end
end