{"action":"created","comment":{"url":"https://api.github.com/repos/spree/spree/pulls/comments/28872145","id":28872145,"diff_hunk":"@@ -0,0 +1,70 @@\n+module Spree\n+  module Api\n+    module V2\n+      class ReturnAuthorizationsController < Spree::Api::BaseController\n+        def create\n+          authorize! :create, ReturnAuthorization\n+          @return_authorization = order.return_authorizations.build(return_authorization_params)\n+          if @return_authorization.save\n+            render json: @return_authorization, status: 201\n+          else\n+            invalid_resource!(@return_authorization)\n+          end\n+        end\n+\n+        def destroy\n+          @return_authorization = order.return_authorizations.accessible_by(current_ability, :destroy).find(params[:id])\n+          @return_authorization.destroy\n+          render nothing: true, status: 204\n+        end\n+\n+        def index\n+          authorize! :admin, ReturnAuthorization\n+          @return_authorizations = order.return_authorizations.accessible_by(current_ability, :read).\n+                                   ransack(params[:q]).result.\n+                                   page(params[:page]).per(params[:per_page])\n+          render json: @return_authorizations, meta: pagination(@return_authorizations)\n+        end\n+\n+        def new\n+          authorize! :admin, ReturnAuthorization\n+        end\n+\n+        def show\n+          authorize! :admin, ReturnAuthorization\n+          @return_authorization = order.return_authorizations.accessible_by(current_ability, :read).find(params[:id])","path":"api/app/controllers/spree/api/v2/return_authorizations_controller.rb","position":35,"original_position":35,"commit_id":"3e95c8b548d662094505c86542e193fb63f98f14","original_commit_id":"3e95c8b548d662094505c86542e193fb63f98f14","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Line is too long. [117/80]","created_at":"2015-04-22T13:36:11Z","updated_at":"2015-04-22T13:36:11Z","html_url":"https://github.com/spree/spree/pull/6309#discussion_r28872145","pull_request_url":"https://api.github.com/repos/spree/spree/pulls/6309","_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/comments/28872145"},"html":{"href":"https://github.com/spree/spree/pull/6309#discussion_r28872145"},"pull_request":{"href":"https://api.github.com/repos/spree/spree/pulls/6309"}}},"pull_request":{"url":"https://api.github.com/repos/spree/spree/pulls/6309","id":33547965,"html_url":"https://github.com/spree/spree/pull/6309","diff_url":"https://github.com/spree/spree/pull/6309.diff","patch_url":"https://github.com/spree/spree/pull/6309.patch","issue_url":"https://api.github.com/repos/spree/spree/issues/6309","number":6309,"state":"open","locked":false,"title":"Keep rabl and implement Active Model Serializer as v2","user":{"login":"yurifrl","id":3260068,"avatar_url":"https://avatars.githubusercontent.com/u/3260068?v=3","gravatar_id":"","url":"https://api.github.com/users/yurifrl","html_url":"https://github.com/yurifrl","followers_url":"https://api.github.com/users/yurifrl/followers","following_url":"https://api.github.com/users/yurifrl/following{/other_user}","gists_url":"https://api.github.com/users/yurifrl/gists{/gist_id}","starred_url":"https://api.github.com/users/yurifrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurifrl/subscriptions","organizations_url":"https://api.github.com/users/yurifrl/orgs","repos_url":"https://api.github.com/users/yurifrl/repos","events_url":"https://api.github.com/users/yurifrl/events{/privacy}","received_events_url":"https://api.github.com/users/yurifrl/received_events","type":"User","site_admin":false},"body":"as @JDutil asked i merged it with master, and now, to organize myself i'm moving https://github.com/spree/spree/pull/6303 to here, there are some things missing, as @BenMorganIO  pointed, such as https://github.com/spree/spree/pull/6280\r\n\r\ni'm also using this thread as a guide line https://github.com/spree/spree/pull/6033","created_at":"2015-04-17T14:15:11Z","updated_at":"2015-04-22T13:36:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"66033996af94a52b9660b39eb0f6860944acc51a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spree/spree/pulls/6309/commits","review_comments_url":"https://api.github.com/repos/spree/spree/pulls/6309/comments","review_comment_url":"https://api.github.com/repos/spree/spree/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spree/spree/issues/6309/comments","statuses_url":"https://api.github.com/repos/spree/spree/statuses/3e95c8b548d662094505c86542e193fb63f98f14","head":{"label":"azclick:ams","ref":"ams","sha":"3e95c8b548d662094505c86542e193fb63f98f14","user":{"login":"azclick","id":4580796,"avatar_url":"https://avatars.githubusercontent.com/u/4580796?v=3","gravatar_id":"","url":"https://api.github.com/users/azclick","html_url":"https://github.com/azclick","followers_url":"https://api.github.com/users/azclick/followers","following_url":"https://api.github.com/users/azclick/following{/other_user}","gists_url":"https://api.github.com/users/azclick/gists{/gist_id}","starred_url":"https://api.github.com/users/azclick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azclick/subscriptions","organizations_url":"https://api.github.com/users/azclick/orgs","repos_url":"https://api.github.com/users/azclick/repos","events_url":"https://api.github.com/users/azclick/events{/privacy}","received_events_url":"https://api.github.com/users/azclick/received_events","type":"Organization","site_admin":false},"repo":{"id":29260453,"name":"spree","full_name":"azclick/spree","owner":{"login":"azclick","id":4580796,"avatar_url":"https://avatars.githubusercontent.com/u/4580796?v=3","gravatar_id":"","url":"https://api.github.com/users/azclick","html_url":"https://github.com/azclick","followers_url":"https://api.github.com/users/azclick/followers","following_url":"https://api.github.com/users/azclick/following{/other_user}","gists_url":"https://api.github.com/users/azclick/gists{/gist_id}","starred_url":"https://api.github.com/users/azclick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azclick/subscriptions","organizations_url":"https://api.github.com/users/azclick/orgs","repos_url":"https://api.github.com/users/azclick/repos","events_url":"https://api.github.com/users/azclick/events{/privacy}","received_events_url":"https://api.github.com/users/azclick/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azclick/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":true,"url":"https://api.github.com/repos/azclick/spree","forks_url":"https://api.github.com/repos/azclick/spree/forks","keys_url":"https://api.github.com/repos/azclick/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azclick/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azclick/spree/teams","hooks_url":"https://api.github.com/repos/azclick/spree/hooks","issue_events_url":"https://api.github.com/repos/azclick/spree/issues/events{/number}","events_url":"https://api.github.com/repos/azclick/spree/events","assignees_url":"https://api.github.com/repos/azclick/spree/assignees{/user}","branches_url":"https://api.github.com/repos/azclick/spree/branches{/branch}","tags_url":"https://api.github.com/repos/azclick/spree/tags","blobs_url":"https://api.github.com/repos/azclick/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azclick/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azclick/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/azclick/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azclick/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/azclick/spree/languages","stargazers_url":"https://api.github.com/repos/azclick/spree/stargazers","contributors_url":"https://api.github.com/repos/azclick/spree/contributors","subscribers_url":"https://api.github.com/repos/azclick/spree/subscribers","subscription_url":"https://api.github.com/repos/azclick/spree/subscription","commits_url":"https://api.github.com/repos/azclick/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/azclick/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/azclick/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/azclick/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/azclick/spree/contents/{+path}","compare_url":"https://api.github.com/repos/azclick/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azclick/spree/merges","archive_url":"https://api.github.com/repos/azclick/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azclick/spree/downloads","issues_url":"https://api.github.com/repos/azclick/spree/issues{/number}","pulls_url":"https://api.github.com/repos/azclick/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/azclick/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/azclick/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azclick/spree/labels{/name}","releases_url":"https://api.github.com/repos/azclick/spree/releases{/id}","created_at":"2015-01-14T19:01:06Z","updated_at":"2015-03-19T13:26:43Z","pushed_at":"2015-04-22T13:35:49Z","git_url":"git://github.com/azclick/spree.git","ssh_url":"git@github.com:azclick/spree.git","clone_url":"https://github.com/azclick/spree.git","svn_url":"https://github.com/azclick/spree","homepage":"http://spreecommerce.com","size":73507,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spree:master","ref":"master","sha":"6134cf222d54402451de71151e8981c07ff83ec0","user":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"repo":{"id":3314,"name":"spree","full_name":"spree/spree","owner":{"login":"spree","id":56702,"avatar_url":"https://avatars.githubusercontent.com/u/56702?v=3","gravatar_id":"","url":"https://api.github.com/users/spree","html_url":"https://github.com/spree","followers_url":"https://api.github.com/users/spree/followers","following_url":"https://api.github.com/users/spree/following{/other_user}","gists_url":"https://api.github.com/users/spree/gists{/gist_id}","starred_url":"https://api.github.com/users/spree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spree/subscriptions","organizations_url":"https://api.github.com/users/spree/orgs","repos_url":"https://api.github.com/users/spree/repos","events_url":"https://api.github.com/users/spree/events{/privacy}","received_events_url":"https://api.github.com/users/spree/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spree/spree","description":"Spree is a complete open source e-commerce solution for Ruby on Rails.","fork":false,"url":"https://api.github.com/repos/spree/spree","forks_url":"https://api.github.com/repos/spree/spree/forks","keys_url":"https://api.github.com/repos/spree/spree/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spree/spree/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spree/spree/teams","hooks_url":"https://api.github.com/repos/spree/spree/hooks","issue_events_url":"https://api.github.com/repos/spree/spree/issues/events{/number}","events_url":"https://api.github.com/repos/spree/spree/events","assignees_url":"https://api.github.com/repos/spree/spree/assignees{/user}","branches_url":"https://api.github.com/repos/spree/spree/branches{/branch}","tags_url":"https://api.github.com/repos/spree/spree/tags","blobs_url":"https://api.github.com/repos/spree/spree/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spree/spree/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spree/spree/git/refs{/sha}","trees_url":"https://api.github.com/repos/spree/spree/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spree/spree/statuses/{sha}","languages_url":"https://api.github.com/repos/spree/spree/languages","stargazers_url":"https://api.github.com/repos/spree/spree/stargazers","contributors_url":"https://api.github.com/repos/spree/spree/contributors","subscribers_url":"https://api.github.com/repos/spree/spree/subscribers","subscription_url":"https://api.github.com/repos/spree/spree/subscription","commits_url":"https://api.github.com/repos/spree/spree/commits{/sha}","git_commits_url":"https://api.github.com/repos/spree/spree/git/commits{/sha}","comments_url":"https://api.github.com/repos/spree/spree/comments{/number}","issue_comment_url":"https://api.github.com/repos/spree/spree/issues/comments{/number}","contents_url":"https://api.github.com/repos/spree/spree/contents/{+path}","compare_url":"https://api.github.com/repos/spree/spree/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spree/spree/merges","archive_url":"https://api.github.com/repos/spree/spree/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spree/spree/downloads","issues_url":"https://api.github.com/repos/spree/spree/issues{/number}","pulls_url":"https://api.github.com/repos/spree/spree/pulls{/number}","milestones_url":"https://api.github.com/repos/spree/spree/milestones{/number}","notifications_url":"https://api.github.com/repos/spree/spree/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spree/spree/labels{/name}","releases_url":"https://api.github.com/repos/spree/spree/releases{/id}","created_at":"2008-03-10T14:45:35Z","updated_at":"2015-04-22T13:08:34Z","pushed_at":"2015-04-22T13:35:53Z","git_url":"git://github.com/spree/spree.git","ssh_url":"git@github.com:spree/spree.git","clone_url":"https://github.com/spree/spree.git","svn_url":"https://github.com/spree/spree","homepage":"http://spreecommerce.com","size":135219,"stargazers_count":6257,"watchers_count":6257,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2930,"mirror_url":null,"open_issues_count":110,"forks":2930,"open_issues":110,"watchers":6257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spree/spree/pulls/6309"},"html":{"href":"https://github.com/spree/spree/pull/6309"},"issue":{"href":"https://api.github.com/repos/spree/spree/issues/6309"},"comments":{"href":"https://api.github.com/repos/spree/spree/issues/6309/comments"},"review_comments":{"href":"https://api.github.com/repos/spree/spree/pulls/6309/comments"},"review_comment":{"href":"https://api.github.com/repos/spree/spree/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spree/spree/pulls/6309/commits"},"statuses":{"href":"https://api.github.com/repos/spree/spree/statuses/3e95c8b548d662094505c86542e193fb63f98f14"}}}}