{"action":"created","issue":{"url":"https://api.github.com/repos/tedexample/shumishareca/issues/77","repository_url":"https://api.github.com/repos/tedexample/shumishareca","labels_url":"https://api.github.com/repos/tedexample/shumishareca/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/tedexample/shumishareca/issues/77/comments","events_url":"https://api.github.com/repos/tedexample/shumishareca/issues/77/events","html_url":"https://github.com/tedexample/shumishareca/pull/77","id":342330025,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMjU0MzY3","number":77,"title":"スコープを使ってFormObjectを構築する","user":{"login":"tedexample","id":38160229,"node_id":"MDQ6VXNlcjM4MTYwMjI5","avatar_url":"https://avatars2.githubusercontent.com/u/38160229?v=4","gravatar_id":"","url":"https://api.github.com/users/tedexample","html_url":"https://github.com/tedexample","followers_url":"https://api.github.com/users/tedexample/followers","following_url":"https://api.github.com/users/tedexample/following{/other_user}","gists_url":"https://api.github.com/users/tedexample/gists{/gist_id}","starred_url":"https://api.github.com/users/tedexample/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tedexample/subscriptions","organizations_url":"https://api.github.com/users/tedexample/orgs","repos_url":"https://api.github.com/users/tedexample/repos","events_url":"https://api.github.com/users/tedexample/events{/privacy}","received_events_url":"https://api.github.com/users/tedexample/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ms2sato","id":627817,"node_id":"MDQ6VXNlcjYyNzgxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/627817?v=4","gravatar_id":"","url":"https://api.github.com/users/ms2sato","html_url":"https://github.com/ms2sato","followers_url":"https://api.github.com/users/ms2sato/followers","following_url":"https://api.github.com/users/ms2sato/following{/other_user}","gists_url":"https://api.github.com/users/ms2sato/gists{/gist_id}","starred_url":"https://api.github.com/users/ms2sato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms2sato/subscriptions","organizations_url":"https://api.github.com/users/ms2sato/orgs","repos_url":"https://api.github.com/users/ms2sato/repos","events_url":"https://api.github.com/users/ms2sato/events{/privacy}","received_events_url":"https://api.github.com/users/ms2sato/received_events","type":"User","site_admin":false},"assignees":[{"login":"ms2sato","id":627817,"node_id":"MDQ6VXNlcjYyNzgxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/627817?v=4","gravatar_id":"","url":"https://api.github.com/users/ms2sato","html_url":"https://github.com/ms2sato","followers_url":"https://api.github.com/users/ms2sato/followers","following_url":"https://api.github.com/users/ms2sato/following{/other_user}","gists_url":"https://api.github.com/users/ms2sato/gists{/gist_id}","starred_url":"https://api.github.com/users/ms2sato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms2sato/subscriptions","organizations_url":"https://api.github.com/users/ms2sato/orgs","repos_url":"https://api.github.com/users/ms2sato/repos","events_url":"https://api.github.com/users/ms2sato/events{/privacy}","received_events_url":"https://api.github.com/users/ms2sato/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-07-18T13:31:56Z","updated_at":"2018-07-20T07:10:37Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/tedexample/shumishareca/pulls/77","html_url":"https://github.com/tedexample/shumishareca/pull/77","diff_url":"https://github.com/tedexample/shumishareca/pull/77.diff","patch_url":"https://github.com/tedexample/shumishareca/pull/77.patch"},"body":"@ms2sato #76の対応です\r\n\r\nスコープ触っている間に何をするものかわかりました。\r\n処理（主に検索形の処理でしょうか）の塊をまとめてメソッドのように呼び出せるようにするものですね。\r\n検索形だけでなく他の処理でも可能のようですね。\r\n\r\nスコープの引数にちょっとはまってしまいましたが、実装できました。"},"comment":{"url":"https://api.github.com/repos/tedexample/shumishareca/issues/comments/406509719","html_url":"https://github.com/tedexample/shumishareca/pull/77#issuecomment-406509719","issue_url":"https://api.github.com/repos/tedexample/shumishareca/issues/77","id":406509719,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjUwOTcxOQ==","user":{"login":"ms2sato","id":627817,"node_id":"MDQ6VXNlcjYyNzgxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/627817?v=4","gravatar_id":"","url":"https://api.github.com/users/ms2sato","html_url":"https://github.com/ms2sato","followers_url":"https://api.github.com/users/ms2sato/followers","following_url":"https://api.github.com/users/ms2sato/following{/other_user}","gists_url":"https://api.github.com/users/ms2sato/gists{/gist_id}","starred_url":"https://api.github.com/users/ms2sato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ms2sato/subscriptions","organizations_url":"https://api.github.com/users/ms2sato/orgs","repos_url":"https://api.github.com/users/ms2sato/repos","events_url":"https://api.github.com/users/ms2sato/events{/privacy}","received_events_url":"https://api.github.com/users/ms2sato/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T07:10:37Z","updated_at":"2018-07-20T07:10:37Z","author_association":"COLLABORATOR","body":"@tedexample 素晴らしい！\r\n\r\n> 処理（主に検索形の処理でしょうか）の塊をまとめてメソッドのように呼び出せるようにするものですね。\r\n\r\nYESです。基本的には検索（ほぼwhere）の処理にしか使いません。他の用途で使うのは誤りなので覚えておいてください。\r\n\r\nまた、 `self.` でクラスメソッドを作ると同様のことができます。scopeはそれが検索条件であり、chainして検索を繋げられるということの表明になります。"}}
{"actor":{"display_login":"ms2sato"}}