{"action":"created","issue":{"url":"https://api.github.com/repos/masarusan24/achieve/issues/6","repository_url":"https://api.github.com/repos/masarusan24/achieve","labels_url":"https://api.github.com/repos/masarusan24/achieve/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/masarusan24/achieve/issues/6/comments","events_url":"https://api.github.com/repos/masarusan24/achieve/issues/6/events","html_url":"https://github.com/masarusan24/achieve/issues/6","id":296591480,"number":6,"title":"SQLクエリ取得量が多すぎる場合のハングを防ぐ","user":{"login":"norotime","id":7435505,"avatar_url":"https://avatars0.githubusercontent.com/u/7435505?v=4","gravatar_id":"","url":"https://api.github.com/users/norotime","html_url":"https://github.com/norotime","followers_url":"https://api.github.com/users/norotime/followers","following_url":"https://api.github.com/users/norotime/following{/other_user}","gists_url":"https://api.github.com/users/norotime/gists{/gist_id}","starred_url":"https://api.github.com/users/norotime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norotime/subscriptions","organizations_url":"https://api.github.com/users/norotime/orgs","repos_url":"https://api.github.com/users/norotime/repos","events_url":"https://api.github.com/users/norotime/events{/privacy}","received_events_url":"https://api.github.com/users/norotime/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-13T02:16:48Z","updated_at":"2018-02-15T04:53:53Z","closed_at":"2018-02-14T15:41:35Z","author_association":"NONE","body":"https://github.com/masarusan24/achieve/blob/ed60fa7e09766f511c82c57177fa8932ec5f076e/app/controllers/blogs_controller.rb#L24\r\n\r\n@masarusan24 allメソッドは極めて危険です。100万件レコードがあるかもしれません。モデル等で制御しましょう。\r\n\r\nlimit\r\nhttps://railsguides.jp/active_record_querying.html#limit%E3%81%A8offset\r\n\r\nscope\r\nhttps://railsguides.jp/active_record_querying.html#%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%97\r\n\r\nコントローラは、アクションの振り分けに注力し、モデルでデータの制御を担うと綺麗です。"},"comment":{"url":"https://api.github.com/repos/masarusan24/achieve/issues/comments/365825204","html_url":"https://github.com/masarusan24/achieve/issues/6#issuecomment-365825204","issue_url":"https://api.github.com/repos/masarusan24/achieve/issues/6","id":365825204,"user":{"login":"masarusan24","id":17737460,"avatar_url":"https://avatars3.githubusercontent.com/u/17737460?v=4","gravatar_id":"","url":"https://api.github.com/users/masarusan24","html_url":"https://github.com/masarusan24","followers_url":"https://api.github.com/users/masarusan24/followers","following_url":"https://api.github.com/users/masarusan24/following{/other_user}","gists_url":"https://api.github.com/users/masarusan24/gists{/gist_id}","starred_url":"https://api.github.com/users/masarusan24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masarusan24/subscriptions","organizations_url":"https://api.github.com/users/masarusan24/orgs","repos_url":"https://api.github.com/users/masarusan24/repos","events_url":"https://api.github.com/users/masarusan24/events{/privacy}","received_events_url":"https://api.github.com/users/masarusan24/received_events","type":"User","site_admin":false},"created_at":"2018-02-15T04:53:53Z","updated_at":"2018-02-15T04:53:53Z","author_association":"OWNER","body":"@norotime https://github.com/masarusan24/achieve/blob/master/app/models/application_record.rb\r\nモデル部分での制御は、こちらの以下の部分になります。\r\n\r\n```\r\n  MAX = 100\r\n  scope :index, -> { limit(MAX) }\r\n```\r\n\r\nで、`BlogsController`のindexアクションをこのようにしています。\r\n\r\n```\r\n  def index\r\n    @blogs = Blog.index\r\n  end\r\n```"}}
{"actor":{"display_login":"masarusan24"}}