{"action":"created","comment":{"url":"https://api.github.com/repos/apotonick/trailblazer/pulls/comments/32184679","id":32184679,"diff_hunk":"@@ -170,7 +170,7 @@ class ControllerPresentTest < ActionController::TestCase\n \n     get :show, id: band.id\n \n-    assert_equal \"bands/show.html: Band,Band,true,Band::Update,Essen\\n\", response.body\n+    assert_equal \"bands/show.html: Band,Band,true,Band::Update,Nofx\", response.body","path":"test/rails/controller_test.rb","position":14,"original_position":14,"commit_id":"d47dae6ecf0c98dd4ad31a951ae9cd10128670c9","original_commit_id":"d47dae6ecf0c98dd4ad31a951ae9cd10128670c9","user":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"body":"Please revert, this is wrong.","created_at":"2015-06-11T02:03:15Z","updated_at":"2015-06-11T02:03:15Z","html_url":"https://github.com/apotonick/trailblazer/pull/39#discussion_r32184679","pull_request_url":"https://api.github.com/repos/apotonick/trailblazer/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/comments/32184679"},"html":{"href":"https://github.com/apotonick/trailblazer/pull/39#discussion_r32184679"},"pull_request":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/apotonick/trailblazer/pulls/39","id":31740134,"html_url":"https://github.com/apotonick/trailblazer/pull/39","diff_url":"https://github.com/apotonick/trailblazer/pull/39.diff","patch_url":"https://github.com/apotonick/trailblazer/pull/39.patch","issue_url":"https://api.github.com/repos/apotonick/trailblazer/issues/39","number":39,"state":"open","locked":false,"title":"Feature: Add pagination and scope to collection","user":{"login":"fernandes","id":517743,"avatar_url":"https://avatars.githubusercontent.com/u/517743?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandes","html_url":"https://github.com/fernandes","followers_url":"https://api.github.com/users/fernandes/followers","following_url":"https://api.github.com/users/fernandes/following{/other_user}","gists_url":"https://api.github.com/users/fernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandes/subscriptions","organizations_url":"https://api.github.com/users/fernandes/orgs","repos_url":"https://api.github.com/users/fernandes/repos","events_url":"https://api.github.com/users/fernandes/events{/privacy}","received_events_url":"https://api.github.com/users/fernandes/received_events","type":"User","site_admin":false},"body":"Imagine every time you want perform a search or a scope, you need to code on `process` method... not anymore!\r\n\r\nThis PR add support for scopes (thanks Ransack) and pagination (thanks Kaminari)\r\n\r\nHow does it work? On your controller to get a collection you do (for more info check https://github.com/apotonick/trailblazer/pull/36):\r\n\r\n```ruby\r\ndef index\r\n  collection Thing::Index\r\nend\r\n```\r\n\r\nOn your operation you need to:\r\n\r\n```ruby\r\nclass Thing < ActiveRecord::Base\r\n  class Index < Trailblazer::Operation\r\n    # including CRUD and setting model is needed for both Scope and Pagination\r\n    include CRUD, Scope, Pagination\r\n    model Thing\r\n  end\r\nend\r\n```\r\n\r\nIn your request you need to pass:\r\n\r\n* `params[:q]` based on Ransack, check its [basic searching page](https://github.com/activerecord-hackery/ransack/wiki/Basic-Searching) for more information about it\r\n\r\n* `params[:page]` for what page you want and `params[:per_page]` for how many results per page will be shown\r\n\r\nAnd thats it... scope and pagination out of the box! :laughing:\r\n","created_at":"2015-03-23T15:03:42Z","updated_at":"2015-06-11T02:03:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4588109bb518a97c38a734f6811e1d30448b75d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apotonick/trailblazer/pulls/39/commits","review_comments_url":"https://api.github.com/repos/apotonick/trailblazer/pulls/39/comments","review_comment_url":"https://api.github.com/repos/apotonick/trailblazer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apotonick/trailblazer/issues/39/comments","statuses_url":"https://api.github.com/repos/apotonick/trailblazer/statuses/d47dae6ecf0c98dd4ad31a951ae9cd10128670c9","head":{"label":"fernandes:feature/add_pagination_and_scope_to_collection","ref":"feature/add_pagination_and_scope_to_collection","sha":"d47dae6ecf0c98dd4ad31a951ae9cd10128670c9","user":{"login":"fernandes","id":517743,"avatar_url":"https://avatars.githubusercontent.com/u/517743?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandes","html_url":"https://github.com/fernandes","followers_url":"https://api.github.com/users/fernandes/followers","following_url":"https://api.github.com/users/fernandes/following{/other_user}","gists_url":"https://api.github.com/users/fernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandes/subscriptions","organizations_url":"https://api.github.com/users/fernandes/orgs","repos_url":"https://api.github.com/users/fernandes/repos","events_url":"https://api.github.com/users/fernandes/events{/privacy}","received_events_url":"https://api.github.com/users/fernandes/received_events","type":"User","site_admin":false},"repo":{"id":25552478,"name":"trailblazer","full_name":"fernandes/trailblazer","owner":{"login":"fernandes","id":517743,"avatar_url":"https://avatars.githubusercontent.com/u/517743?v=3","gravatar_id":"","url":"https://api.github.com/users/fernandes","html_url":"https://github.com/fernandes","followers_url":"https://api.github.com/users/fernandes/followers","following_url":"https://api.github.com/users/fernandes/following{/other_user}","gists_url":"https://api.github.com/users/fernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/fernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fernandes/subscriptions","organizations_url":"https://api.github.com/users/fernandes/orgs","repos_url":"https://api.github.com/users/fernandes/repos","events_url":"https://api.github.com/users/fernandes/events{/privacy}","received_events_url":"https://api.github.com/users/fernandes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fernandes/trailblazer","description":"A New Architecture For Rails.","fork":true,"url":"https://api.github.com/repos/fernandes/trailblazer","forks_url":"https://api.github.com/repos/fernandes/trailblazer/forks","keys_url":"https://api.github.com/repos/fernandes/trailblazer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fernandes/trailblazer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fernandes/trailblazer/teams","hooks_url":"https://api.github.com/repos/fernandes/trailblazer/hooks","issue_events_url":"https://api.github.com/repos/fernandes/trailblazer/issues/events{/number}","events_url":"https://api.github.com/repos/fernandes/trailblazer/events","assignees_url":"https://api.github.com/repos/fernandes/trailblazer/assignees{/user}","branches_url":"https://api.github.com/repos/fernandes/trailblazer/branches{/branch}","tags_url":"https://api.github.com/repos/fernandes/trailblazer/tags","blobs_url":"https://api.github.com/repos/fernandes/trailblazer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fernandes/trailblazer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fernandes/trailblazer/git/refs{/sha}","trees_url":"https://api.github.com/repos/fernandes/trailblazer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fernandes/trailblazer/statuses/{sha}","languages_url":"https://api.github.com/repos/fernandes/trailblazer/languages","stargazers_url":"https://api.github.com/repos/fernandes/trailblazer/stargazers","contributors_url":"https://api.github.com/repos/fernandes/trailblazer/contributors","subscribers_url":"https://api.github.com/repos/fernandes/trailblazer/subscribers","subscription_url":"https://api.github.com/repos/fernandes/trailblazer/subscription","commits_url":"https://api.github.com/repos/fernandes/trailblazer/commits{/sha}","git_commits_url":"https://api.github.com/repos/fernandes/trailblazer/git/commits{/sha}","comments_url":"https://api.github.com/repos/fernandes/trailblazer/comments{/number}","issue_comment_url":"https://api.github.com/repos/fernandes/trailblazer/issues/comments{/number}","contents_url":"https://api.github.com/repos/fernandes/trailblazer/contents/{+path}","compare_url":"https://api.github.com/repos/fernandes/trailblazer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fernandes/trailblazer/merges","archive_url":"https://api.github.com/repos/fernandes/trailblazer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fernandes/trailblazer/downloads","issues_url":"https://api.github.com/repos/fernandes/trailblazer/issues{/number}","pulls_url":"https://api.github.com/repos/fernandes/trailblazer/pulls{/number}","milestones_url":"https://api.github.com/repos/fernandes/trailblazer/milestones{/number}","notifications_url":"https://api.github.com/repos/fernandes/trailblazer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fernandes/trailblazer/labels{/name}","releases_url":"https://api.github.com/repos/fernandes/trailblazer/releases{/id}","created_at":"2014-10-22T00:04:54Z","updated_at":"2015-04-02T17:31:49Z","pushed_at":"2015-06-11T01:03:35Z","git_url":"git://github.com/fernandes/trailblazer.git","ssh_url":"git@github.com:fernandes/trailblazer.git","clone_url":"https://github.com/fernandes/trailblazer.git","svn_url":"https://github.com/fernandes/trailblazer","homepage":"","size":834,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"fork"}},"base":{"label":"apotonick:master","ref":"master","sha":"107cea3496dc0cf810ff0f3cbb6ecea2b76e12e2","user":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"repo":{"id":10955751,"name":"trailblazer","full_name":"apotonick/trailblazer","owner":{"login":"apotonick","id":10406,"avatar_url":"https://avatars.githubusercontent.com/u/10406?v=3","gravatar_id":"","url":"https://api.github.com/users/apotonick","html_url":"https://github.com/apotonick","followers_url":"https://api.github.com/users/apotonick/followers","following_url":"https://api.github.com/users/apotonick/following{/other_user}","gists_url":"https://api.github.com/users/apotonick/gists{/gist_id}","starred_url":"https://api.github.com/users/apotonick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apotonick/subscriptions","organizations_url":"https://api.github.com/users/apotonick/orgs","repos_url":"https://api.github.com/users/apotonick/repos","events_url":"https://api.github.com/users/apotonick/events{/privacy}","received_events_url":"https://api.github.com/users/apotonick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apotonick/trailblazer","description":"A new architecture for Rails.","fork":false,"url":"https://api.github.com/repos/apotonick/trailblazer","forks_url":"https://api.github.com/repos/apotonick/trailblazer/forks","keys_url":"https://api.github.com/repos/apotonick/trailblazer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apotonick/trailblazer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apotonick/trailblazer/teams","hooks_url":"https://api.github.com/repos/apotonick/trailblazer/hooks","issue_events_url":"https://api.github.com/repos/apotonick/trailblazer/issues/events{/number}","events_url":"https://api.github.com/repos/apotonick/trailblazer/events","assignees_url":"https://api.github.com/repos/apotonick/trailblazer/assignees{/user}","branches_url":"https://api.github.com/repos/apotonick/trailblazer/branches{/branch}","tags_url":"https://api.github.com/repos/apotonick/trailblazer/tags","blobs_url":"https://api.github.com/repos/apotonick/trailblazer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apotonick/trailblazer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apotonick/trailblazer/git/refs{/sha}","trees_url":"https://api.github.com/repos/apotonick/trailblazer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apotonick/trailblazer/statuses/{sha}","languages_url":"https://api.github.com/repos/apotonick/trailblazer/languages","stargazers_url":"https://api.github.com/repos/apotonick/trailblazer/stargazers","contributors_url":"https://api.github.com/repos/apotonick/trailblazer/contributors","subscribers_url":"https://api.github.com/repos/apotonick/trailblazer/subscribers","subscription_url":"https://api.github.com/repos/apotonick/trailblazer/subscription","commits_url":"https://api.github.com/repos/apotonick/trailblazer/commits{/sha}","git_commits_url":"https://api.github.com/repos/apotonick/trailblazer/git/commits{/sha}","comments_url":"https://api.github.com/repos/apotonick/trailblazer/comments{/number}","issue_comment_url":"https://api.github.com/repos/apotonick/trailblazer/issues/comments{/number}","contents_url":"https://api.github.com/repos/apotonick/trailblazer/contents/{+path}","compare_url":"https://api.github.com/repos/apotonick/trailblazer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apotonick/trailblazer/merges","archive_url":"https://api.github.com/repos/apotonick/trailblazer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apotonick/trailblazer/downloads","issues_url":"https://api.github.com/repos/apotonick/trailblazer/issues{/number}","pulls_url":"https://api.github.com/repos/apotonick/trailblazer/pulls{/number}","milestones_url":"https://api.github.com/repos/apotonick/trailblazer/milestones{/number}","notifications_url":"https://api.github.com/repos/apotonick/trailblazer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apotonick/trailblazer/labels{/name}","releases_url":"https://api.github.com/repos/apotonick/trailblazer/releases{/id}","created_at":"2013-06-26T02:03:42Z","updated_at":"2015-06-10T12:40:55Z","pushed_at":"2015-06-11T01:03:35Z","git_url":"git://github.com/apotonick/trailblazer.git","ssh_url":"git@github.com:apotonick/trailblazer.git","clone_url":"https://github.com/apotonick/trailblazer.git","svn_url":"https://github.com/apotonick/trailblazer","homepage":"http://www.trailblazerb.org","size":1597,"stargazers_count":1176,"watchers_count":1176,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":42,"mirror_url":null,"open_issues_count":12,"forks":42,"open_issues":12,"watchers":1176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/39"},"html":{"href":"https://github.com/apotonick/trailblazer/pull/39"},"issue":{"href":"https://api.github.com/repos/apotonick/trailblazer/issues/39"},"comments":{"href":"https://api.github.com/repos/apotonick/trailblazer/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apotonick/trailblazer/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/apotonick/trailblazer/statuses/d47dae6ecf0c98dd4ad31a951ae9cd10128670c9"}}}}