{"action":"created","comment":{"url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/comments/77950265","id":77950265,"diff_hunk":"@@ -0,0 +1,24 @@\n+class StocksController < ApplicationController\n+  protect_from_forgery with: :null_session\n+\n+  skip_before_action :authorize,     :set_current_info, :set_locale, :access_control\n+  before_action      :api_authorize, :set_current_info, :set_locale, :access_control, :find_product\n+\n+  def stock_available_per_warehouse\n+    unless params[:warehouse_ids] && params[:warehouse_ids].respond_to?(:each_with_object)\n+      return render json: { error: 'warehouse_ids parameter is required' }, status: :bad_request\n+    end\n+\n+    stock = Rails.cache.fetch(\"#{@product.id}/#{@product.shelf_locations.maximum(:muutospvm)}\") do","path":"app/controllers/stocks_controller.rb","position":12,"original_position":12,"commit_id":"8126b482263225203c090b08c66a41d78dc534d2","original_commit_id":"8126b482263225203c090b08c66a41d78dc534d2","user":{"login":"tiere","id":3338413,"avatar_url":"https://avatars.githubusercontent.com/u/3338413?v=3","gravatar_id":"","url":"https://api.github.com/users/tiere","html_url":"https://github.com/tiere","followers_url":"https://api.github.com/users/tiere/followers","following_url":"https://api.github.com/users/tiere/following{/other_user}","gists_url":"https://api.github.com/users/tiere/gists{/gist_id}","starred_url":"https://api.github.com/users/tiere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiere/subscriptions","organizations_url":"https://api.github.com/users/tiere/orgs","repos_url":"https://api.github.com/users/tiere/repos","events_url":"https://api.github.com/users/tiere/events{/privacy}","received_events_url":"https://api.github.com/users/tiere/received_events","type":"User","site_admin":false},"body":"Joo, oot oikeessa @jonikanerva. Fixaan tän.","created_at":"2016-09-08T06:04:25Z","updated_at":"2016-09-08T06:04:25Z","html_url":"https://github.com/devlab-oy/pupenext/pull/285#discussion_r77950265","pull_request_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285","_links":{"self":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/comments/77950265"},"html":{"href":"https://github.com/devlab-oy/pupenext/pull/285#discussion_r77950265"},"pull_request":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285"}}},"pull_request":{"url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285","id":84077705,"html_url":"https://github.com/devlab-oy/pupenext/pull/285","diff_url":"https://github.com/devlab-oy/pupenext/pull/285.diff","patch_url":"https://github.com/devlab-oy/pupenext/pull/285.patch","issue_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/285","number":285,"state":"open","locked":false,"title":"Stock","user":{"login":"tiere","id":3338413,"avatar_url":"https://avatars.githubusercontent.com/u/3338413?v=3","gravatar_id":"","url":"https://api.github.com/users/tiere","html_url":"https://github.com/tiere","followers_url":"https://api.github.com/users/tiere/followers","following_url":"https://api.github.com/users/tiere/following{/other_user}","gists_url":"https://api.github.com/users/tiere/gists{/gist_id}","starred_url":"https://api.github.com/users/tiere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiere/subscriptions","organizations_url":"https://api.github.com/users/tiere/orgs","repos_url":"https://api.github.com/users/tiere/repos","events_url":"https://api.github.com/users/tiere/events{/privacy}","received_events_url":"https://api.github.com/users/tiere/received_events","type":"User","site_admin":false},"body":"* Refactor stock functionality from Product model to Stock class\r\n* Create StocksController","created_at":"2016-09-06T08:09:38Z","updated_at":"2016-09-08T06:04:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0406d886b618b0480d5685a0925705d847eedd35","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285/commits","review_comments_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285/comments","review_comment_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls/comments{/number}","comments_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/285/comments","statuses_url":"https://api.github.com/repos/devlab-oy/pupenext/statuses/8126b482263225203c090b08c66a41d78dc534d2","head":{"label":"devlab-oy:tommi/stock","ref":"tommi/stock","sha":"8126b482263225203c090b08c66a41d78dc534d2","user":{"login":"devlab-oy","id":679728,"avatar_url":"https://avatars.githubusercontent.com/u/679728?v=3","gravatar_id":"","url":"https://api.github.com/users/devlab-oy","html_url":"https://github.com/devlab-oy","followers_url":"https://api.github.com/users/devlab-oy/followers","following_url":"https://api.github.com/users/devlab-oy/following{/other_user}","gists_url":"https://api.github.com/users/devlab-oy/gists{/gist_id}","starred_url":"https://api.github.com/users/devlab-oy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlab-oy/subscriptions","organizations_url":"https://api.github.com/users/devlab-oy/orgs","repos_url":"https://api.github.com/users/devlab-oy/repos","events_url":"https://api.github.com/users/devlab-oy/events{/privacy}","received_events_url":"https://api.github.com/users/devlab-oy/received_events","type":"Organization","site_admin":false},"repo":{"id":15131726,"name":"pupenext","full_name":"devlab-oy/pupenext","owner":{"login":"devlab-oy","id":679728,"avatar_url":"https://avatars.githubusercontent.com/u/679728?v=3","gravatar_id":"","url":"https://api.github.com/users/devlab-oy","html_url":"https://github.com/devlab-oy","followers_url":"https://api.github.com/users/devlab-oy/followers","following_url":"https://api.github.com/users/devlab-oy/following{/other_user}","gists_url":"https://api.github.com/users/devlab-oy/gists{/gist_id}","starred_url":"https://api.github.com/users/devlab-oy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlab-oy/subscriptions","organizations_url":"https://api.github.com/users/devlab-oy/orgs","repos_url":"https://api.github.com/users/devlab-oy/repos","events_url":"https://api.github.com/users/devlab-oy/events{/privacy}","received_events_url":"https://api.github.com/users/devlab-oy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devlab-oy/pupenext","description":"Ruby on Rails implementaatio Pupesoft -toiminnanohjausjärjestelmästä.","fork":false,"url":"https://api.github.com/repos/devlab-oy/pupenext","forks_url":"https://api.github.com/repos/devlab-oy/pupenext/forks","keys_url":"https://api.github.com/repos/devlab-oy/pupenext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devlab-oy/pupenext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devlab-oy/pupenext/teams","hooks_url":"https://api.github.com/repos/devlab-oy/pupenext/hooks","issue_events_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/events{/number}","events_url":"https://api.github.com/repos/devlab-oy/pupenext/events","assignees_url":"https://api.github.com/repos/devlab-oy/pupenext/assignees{/user}","branches_url":"https://api.github.com/repos/devlab-oy/pupenext/branches{/branch}","tags_url":"https://api.github.com/repos/devlab-oy/pupenext/tags","blobs_url":"https://api.github.com/repos/devlab-oy/pupenext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devlab-oy/pupenext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devlab-oy/pupenext/git/refs{/sha}","trees_url":"https://api.github.com/repos/devlab-oy/pupenext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devlab-oy/pupenext/statuses/{sha}","languages_url":"https://api.github.com/repos/devlab-oy/pupenext/languages","stargazers_url":"https://api.github.com/repos/devlab-oy/pupenext/stargazers","contributors_url":"https://api.github.com/repos/devlab-oy/pupenext/contributors","subscribers_url":"https://api.github.com/repos/devlab-oy/pupenext/subscribers","subscription_url":"https://api.github.com/repos/devlab-oy/pupenext/subscription","commits_url":"https://api.github.com/repos/devlab-oy/pupenext/commits{/sha}","git_commits_url":"https://api.github.com/repos/devlab-oy/pupenext/git/commits{/sha}","comments_url":"https://api.github.com/repos/devlab-oy/pupenext/comments{/number}","issue_comment_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/comments{/number}","contents_url":"https://api.github.com/repos/devlab-oy/pupenext/contents/{+path}","compare_url":"https://api.github.com/repos/devlab-oy/pupenext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devlab-oy/pupenext/merges","archive_url":"https://api.github.com/repos/devlab-oy/pupenext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devlab-oy/pupenext/downloads","issues_url":"https://api.github.com/repos/devlab-oy/pupenext/issues{/number}","pulls_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls{/number}","milestones_url":"https://api.github.com/repos/devlab-oy/pupenext/milestones{/number}","notifications_url":"https://api.github.com/repos/devlab-oy/pupenext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devlab-oy/pupenext/labels{/name}","releases_url":"https://api.github.com/repos/devlab-oy/pupenext/releases{/id}","deployments_url":"https://api.github.com/repos/devlab-oy/pupenext/deployments","created_at":"2013-12-12T09:22:06Z","updated_at":"2016-01-12T14:06:17Z","pushed_at":"2016-09-07T12:58:53Z","git_url":"git://github.com/devlab-oy/pupenext.git","ssh_url":"git@github.com:devlab-oy/pupenext.git","clone_url":"https://github.com/devlab-oy/pupenext.git","svn_url":"https://github.com/devlab-oy/pupenext","homepage":"www.devlab.fi","size":5501,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"base":{"label":"devlab-oy:master","ref":"master","sha":"bf4729ca0f41478bf2f182c5c56f80c910c7925f","user":{"login":"devlab-oy","id":679728,"avatar_url":"https://avatars.githubusercontent.com/u/679728?v=3","gravatar_id":"","url":"https://api.github.com/users/devlab-oy","html_url":"https://github.com/devlab-oy","followers_url":"https://api.github.com/users/devlab-oy/followers","following_url":"https://api.github.com/users/devlab-oy/following{/other_user}","gists_url":"https://api.github.com/users/devlab-oy/gists{/gist_id}","starred_url":"https://api.github.com/users/devlab-oy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlab-oy/subscriptions","organizations_url":"https://api.github.com/users/devlab-oy/orgs","repos_url":"https://api.github.com/users/devlab-oy/repos","events_url":"https://api.github.com/users/devlab-oy/events{/privacy}","received_events_url":"https://api.github.com/users/devlab-oy/received_events","type":"Organization","site_admin":false},"repo":{"id":15131726,"name":"pupenext","full_name":"devlab-oy/pupenext","owner":{"login":"devlab-oy","id":679728,"avatar_url":"https://avatars.githubusercontent.com/u/679728?v=3","gravatar_id":"","url":"https://api.github.com/users/devlab-oy","html_url":"https://github.com/devlab-oy","followers_url":"https://api.github.com/users/devlab-oy/followers","following_url":"https://api.github.com/users/devlab-oy/following{/other_user}","gists_url":"https://api.github.com/users/devlab-oy/gists{/gist_id}","starred_url":"https://api.github.com/users/devlab-oy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devlab-oy/subscriptions","organizations_url":"https://api.github.com/users/devlab-oy/orgs","repos_url":"https://api.github.com/users/devlab-oy/repos","events_url":"https://api.github.com/users/devlab-oy/events{/privacy}","received_events_url":"https://api.github.com/users/devlab-oy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/devlab-oy/pupenext","description":"Ruby on Rails implementaatio Pupesoft -toiminnanohjausjärjestelmästä.","fork":false,"url":"https://api.github.com/repos/devlab-oy/pupenext","forks_url":"https://api.github.com/repos/devlab-oy/pupenext/forks","keys_url":"https://api.github.com/repos/devlab-oy/pupenext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devlab-oy/pupenext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devlab-oy/pupenext/teams","hooks_url":"https://api.github.com/repos/devlab-oy/pupenext/hooks","issue_events_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/events{/number}","events_url":"https://api.github.com/repos/devlab-oy/pupenext/events","assignees_url":"https://api.github.com/repos/devlab-oy/pupenext/assignees{/user}","branches_url":"https://api.github.com/repos/devlab-oy/pupenext/branches{/branch}","tags_url":"https://api.github.com/repos/devlab-oy/pupenext/tags","blobs_url":"https://api.github.com/repos/devlab-oy/pupenext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devlab-oy/pupenext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devlab-oy/pupenext/git/refs{/sha}","trees_url":"https://api.github.com/repos/devlab-oy/pupenext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devlab-oy/pupenext/statuses/{sha}","languages_url":"https://api.github.com/repos/devlab-oy/pupenext/languages","stargazers_url":"https://api.github.com/repos/devlab-oy/pupenext/stargazers","contributors_url":"https://api.github.com/repos/devlab-oy/pupenext/contributors","subscribers_url":"https://api.github.com/repos/devlab-oy/pupenext/subscribers","subscription_url":"https://api.github.com/repos/devlab-oy/pupenext/subscription","commits_url":"https://api.github.com/repos/devlab-oy/pupenext/commits{/sha}","git_commits_url":"https://api.github.com/repos/devlab-oy/pupenext/git/commits{/sha}","comments_url":"https://api.github.com/repos/devlab-oy/pupenext/comments{/number}","issue_comment_url":"https://api.github.com/repos/devlab-oy/pupenext/issues/comments{/number}","contents_url":"https://api.github.com/repos/devlab-oy/pupenext/contents/{+path}","compare_url":"https://api.github.com/repos/devlab-oy/pupenext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devlab-oy/pupenext/merges","archive_url":"https://api.github.com/repos/devlab-oy/pupenext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devlab-oy/pupenext/downloads","issues_url":"https://api.github.com/repos/devlab-oy/pupenext/issues{/number}","pulls_url":"https://api.github.com/repos/devlab-oy/pupenext/pulls{/number}","milestones_url":"https://api.github.com/repos/devlab-oy/pupenext/milestones{/number}","notifications_url":"https://api.github.com/repos/devlab-oy/pupenext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devlab-oy/pupenext/labels{/name}","releases_url":"https://api.github.com/repos/devlab-oy/pupenext/releases{/id}","deployments_url":"https://api.github.com/repos/devlab-oy/pupenext/deployments","created_at":"2013-12-12T09:22:06Z","updated_at":"2016-01-12T14:06:17Z","pushed_at":"2016-09-07T12:58:53Z","git_url":"git://github.com/devlab-oy/pupenext.git","ssh_url":"git@github.com:devlab-oy/pupenext.git","clone_url":"https://github.com/devlab-oy/pupenext.git","svn_url":"https://github.com/devlab-oy/pupenext","homepage":"www.devlab.fi","size":5501,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285"},"html":{"href":"https://github.com/devlab-oy/pupenext/pull/285"},"issue":{"href":"https://api.github.com/repos/devlab-oy/pupenext/issues/285"},"comments":{"href":"https://api.github.com/repos/devlab-oy/pupenext/issues/285/comments"},"review_comments":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285/comments"},"review_comment":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/devlab-oy/pupenext/pulls/285/commits"},"statuses":{"href":"https://api.github.com/repos/devlab-oy/pupenext/statuses/8126b482263225203c090b08c66a41d78dc534d2"}}}}
{"actor":{"display_login":"tiere"}}