{"action":"opened","issue":{"url":"https://api.github.com/repos/nikkypx/her/issues/29","repository_url":"https://api.github.com/repos/nikkypx/her","labels_url":"https://api.github.com/repos/nikkypx/her/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/nikkypx/her/issues/29/comments","events_url":"https://api.github.com/repos/nikkypx/her/issues/29/events","html_url":"https://github.com/nikkypx/her/issues/29","id":168473051,"number":29,"title":"Scopes defines on Her::Model::Relation instead of child class","user":{"login":"nikkypx","id":4976904,"avatar_url":"https://avatars.githubusercontent.com/u/4976904?v=3","gravatar_id":"","url":"https://api.github.com/users/nikkypx","html_url":"https://github.com/nikkypx","followers_url":"https://api.github.com/users/nikkypx/followers","following_url":"https://api.github.com/users/nikkypx/following{/other_user}","gists_url":"https://api.github.com/users/nikkypx/gists{/gist_id}","starred_url":"https://api.github.com/users/nikkypx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikkypx/subscriptions","organizations_url":"https://api.github.com/users/nikkypx/orgs","repos_url":"https://api.github.com/users/nikkypx/repos","events_url":"https://api.github.com/users/nikkypx/events{/privacy}","received_events_url":"https://api.github.com/users/nikkypx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-30T15:37:55Z","updated_at":"2016-07-30T15:37:55Z","closed_at":null,"body":"Hi everyone. Today I run into the problem that I have scope defined in one model appears in other model.  See my code example:\r\n\r\n```\r\n[1] pry(main)> class Model\r\n[1] pry(main)*   include Her::Model\r\n[1] pry(main)* end\r\n=> Model\r\n[2] pry(main)> class Model2 < Model\r\n[2] pry(main)*   scope :test_me, -> { where(page: 1) }\r\n[2] pry(main)* end\r\n=> :test_me\r\n[3] pry(main)> class Model3 < Model\r\n[3] pry(main)* end\r\n=> nil\r\n[4] pry(main)> Model3.all.respond_to?(:test_me)\r\n=> true\r\n[7] pry(main)> Her::Model::Relation.instance_methods.grep(/test_me/)\r\n=> [:test_me]\r\n```\r\n\r\nseems the issue on this line https://github.com/remiprev/her/blob/master/lib/her/model/orm.rb#L110\r\n`scope` defines on base class `Her::Model::Relation` instead of child scoped"}}
{"actor":{"display_login":"nikkypx"}}