Hey guys. I’m trying to get latest posts with help of Discourse Api gem.
I’ve added next lines to my initializer:
module DiscourseApi
module API
module Posts
def latest_posts(params = {})
response = get('/posts', params)
response[:body]['latest_posts']
end
end
end
end
On Friday everything worked fine, I was able to get latest posts. But now it responses with 500 status
Started GET "/posts.json" for 162.158.102.26 at 2015-12-14 21:17:01 +0000
Processing by PostsController#latest as JSON
Completed 500 Internal Server Error in 102ms (ActiveRecord: 15.6ms)
NoMethodError (undefined method `title' for nil:NilClass)
/var/www/discourse/app/serializers/post_serializer.rb:93:in `topic_title'