{"action":"created","issue":{"url":"https://api.github.com/repos/rom-rb/rom-repository/issues/1","labels_url":"https://api.github.com/repos/rom-rb/rom-repository/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/rom-rb/rom-repository/issues/1/comments","events_url":"https://api.github.com/repos/rom-rb/rom-repository/issues/1/events","html_url":"https://github.com/rom-rb/rom-repository/issues/1","id":102369593,"number":1,"title":"Setup Interface","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-21T12:30:02Z","updated_at":"2015-09-04T14:06:31Z","closed_at":null,"body":"As a higher-level abstraction `Repository` should provide a way of setting up a simpler persistence layer where relations and commands are automatically generated. You could setup repositories for specific adapters.\r\n\r\nInterface idea:\r\n\r\n``` ruby\r\nclass PostgresRepository < ROM::Repository::Base # still Base until we remove it from rom core\r\n  gateway :default do |config|\r\n    config.uri = 'postgres://localhost/rom'\r\n  end\r\nend\r\n\r\nclass UserRepository < PostgresRepository\r\n  # a repo must be able to access 1 or more relations!\r\n  relations :users\r\n\r\n  # a repo can access many commands, we can apply defaults too\r\n  commands users: [:create, :update, :delete]\r\n \r\n  def active\r\n    users.where(active: true)\r\n  end\r\n\r\n  def by_id(id)\r\n    users.where(id: id)\r\n  end\r\nend\r\n\r\nuser_repo = UserRepository.new # just works\r\n\r\n# works the same way as now\r\nuser_repo.active.by_id(1)\r\n\r\n# CUD interface\r\nuser_repo.create(user)\r\nuser_repo.update(user)\r\nuser_repo.delete(user)\r\n```"},"comment":{"url":"https://api.github.com/repos/rom-rb/rom-repository/issues/comments/137746245","html_url":"https://github.com/rom-rb/rom-repository/issues/1#issuecomment-137746245","issue_url":"https://api.github.com/repos/rom-rb/rom-repository/issues/1","id":137746245,"user":{"login":"endash","id":20806,"avatar_url":"https://avatars.githubusercontent.com/u/20806?v=3","gravatar_id":"","url":"https://api.github.com/users/endash","html_url":"https://github.com/endash","followers_url":"https://api.github.com/users/endash/followers","following_url":"https://api.github.com/users/endash/following{/other_user}","gists_url":"https://api.github.com/users/endash/gists{/gist_id}","starred_url":"https://api.github.com/users/endash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endash/subscriptions","organizations_url":"https://api.github.com/users/endash/orgs","repos_url":"https://api.github.com/users/endash/repos","events_url":"https://api.github.com/users/endash/events{/privacy}","received_events_url":"https://api.github.com/users/endash/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T14:06:31Z","updated_at":"2015-09-04T14:06:31Z","body":"@solnic OK, that's perfect, then. I didn't exhaustively audit the code so I was making an educated guess that the mapper generation (`attributes` -> mapper has attributes... let's call it a day for that investigation) had something to do with it. "}}