{"action":"created","issue":{"url":"https://api.github.com/repos/flyerhzm/bullet/issues/261","labels_url":"https://api.github.com/repos/flyerhzm/bullet/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/flyerhzm/bullet/issues/261/comments","events_url":"https://api.github.com/repos/flyerhzm/bullet/issues/261/events","html_url":"https://github.com/flyerhzm/bullet/issues/261","id":114190481,"number":261,"title":"How would I solve this?","user":{"login":"AmitJoki","id":5158554,"avatar_url":"https://avatars.githubusercontent.com/u/5158554?v=3","gravatar_id":"","url":"https://api.github.com/users/AmitJoki","html_url":"https://github.com/AmitJoki","followers_url":"https://api.github.com/users/AmitJoki/followers","following_url":"https://api.github.com/users/AmitJoki/following{/other_user}","gists_url":"https://api.github.com/users/AmitJoki/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitJoki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitJoki/subscriptions","organizations_url":"https://api.github.com/users/AmitJoki/orgs","repos_url":"https://api.github.com/users/AmitJoki/repos","events_url":"https://api.github.com/users/AmitJoki/events{/privacy}","received_events_url":"https://api.github.com/users/AmitJoki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-30T03:09:33Z","updated_at":"2015-10-30T03:11:50Z","closed_at":null,"body":"I'm using `comment.user` and I'm using the following code to populate comments:\r\n\r\n    @comments = Post.find(params[:post_id]).comments.hash_tree(limit_depth: 3)\r\n\r\nNow, [Bullet](https://github.com/flyerhzm/bullet) shows:\r\n\r\n> `N + 1` Query Detected\r\n\r\n> `Comment => [:user]`\r\n\r\n> Add to finder: `:includes => [:user]`\r\n\r\nNow, I tried `Post.includes(:comments, :user)`, `Post.includes(comments: :user)` and other such variation, but the Bullet keeps informing me that the N+1 query persists.\r\n\r\nModels and associations:\r\n\r\n\r\n    class User < ActiveRecord::Base\r\n      has_many :posts\r\n      has_many :comments\r\n    end\r\n    class Post < ActiveRecord::Base\r\n      belongs_to :user\r\n      has_many :comments, dependent: :destroy\r\n    end\r\n    class Comment < ActiveRecord::Base\r\n      belongs_to :user\r\n      belongs_to :post\r\n    end\r\n\r\nHow can I solve it? I've tried many things and have also asked a question on Stack Overflow, and have tried [those answers](http://stackoverflow.com/questions/33421083/how-to-solve-this-n1-query-for-2-associations) too but in vain."},"comment":{"url":"https://api.github.com/repos/flyerhzm/bullet/issues/comments/152398556","html_url":"https://github.com/flyerhzm/bullet/issues/261#issuecomment-152398556","issue_url":"https://api.github.com/repos/flyerhzm/bullet/issues/261","id":152398556,"user":{"login":"flyerhzm","id":66836,"avatar_url":"https://avatars.githubusercontent.com/u/66836?v=3","gravatar_id":"","url":"https://api.github.com/users/flyerhzm","html_url":"https://github.com/flyerhzm","followers_url":"https://api.github.com/users/flyerhzm/followers","following_url":"https://api.github.com/users/flyerhzm/following{/other_user}","gists_url":"https://api.github.com/users/flyerhzm/gists{/gist_id}","starred_url":"https://api.github.com/users/flyerhzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flyerhzm/subscriptions","organizations_url":"https://api.github.com/users/flyerhzm/orgs","repos_url":"https://api.github.com/users/flyerhzm/repos","events_url":"https://api.github.com/users/flyerhzm/events{/privacy}","received_events_url":"https://api.github.com/users/flyerhzm/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T03:11:50Z","updated_at":"2015-10-30T03:11:50Z","body":"@AmitJoki could you list the sql queries in your development.log?"}}