{"action":"opened","issue":{"url":"https://api.github.com/repos/hanami/model/issues/380","repository_url":"https://api.github.com/repos/hanami/model","labels_url":"https://api.github.com/repos/hanami/model/issues/380/labels{/name}","comments_url":"https://api.github.com/repos/hanami/model/issues/380/comments","events_url":"https://api.github.com/repos/hanami/model/issues/380/events","html_url":"https://github.com/hanami/model/issues/380","id":207480746,"number":380,"title":"`last` method always returns a hash","user":{"login":"gizotti","id":1103597,"avatar_url":"https://avatars.githubusercontent.com/u/1103597?v=3","gravatar_id":"","url":"https://api.github.com/users/gizotti","html_url":"https://github.com/gizotti","followers_url":"https://api.github.com/users/gizotti/followers","following_url":"https://api.github.com/users/gizotti/following{/other_user}","gists_url":"https://api.github.com/users/gizotti/gists{/gist_id}","starred_url":"https://api.github.com/users/gizotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizotti/subscriptions","organizations_url":"https://api.github.com/users/gizotti/orgs","repos_url":"https://api.github.com/users/gizotti/repos","events_url":"https://api.github.com/users/gizotti/events{/privacy}","received_events_url":"https://api.github.com/users/gizotti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-14T10:48:10Z","updated_at":"2017-02-14T10:48:10Z","closed_at":null,"body":"I have the following repository:\r\n\r\n```ruby\r\nclass PostRepository < Hanami::Repository\r\n  def newest_post\r\n     root.order(:created_at).as(:entity).last\r\n  end\r\nend\r\n```\r\n\r\nThe `newest_post` method will always return a `Hash` instead of an `Post` instance.\r\nIf I change `last` to `first`, I get a `Post` instance as I want.\r\n\r\nI have no clue where to start looking for the problem. If someone could give me a clue, I can try to fix this one myself."}}
{"actor":{"display_login":"gizotti"}}