{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/management_devise_01/pulls/comments/121343117","pull_request_review_id":43382568,"id":121343117,"diff_hunk":"@@ -27,38 +27,48 @@ class Device < ApplicationRecord\n   validates :original_price, presence: true\n   validate :buy_before_create\n \n-  scope :find_assigne_device, ->(user_id){where \"id in (select d.id from\n+  QUERRY_USER_BRORROW_DEVICE = \"id in(SELECT devices.id from assignments\n+  inner join assignment_details on assignment_details.assignment_id = assignments.id\n+  inner join devices on devices.id = assignment_details.device_id\n+  where assignments.assignee_id = :user_id)\"\n+\n+  scope :find_assigne_device, (lambda do |user_id|\n+    where \"id in (select d.id from\n     devices as d join assignment_details asd on d.id = asd.device_id\n     join assignments as a on a.id = asd.assignment_id where a.assignee_id = ?)\",\n-    user_id}\n-  scope :of_category, ->device_category_id do\n+    user_id\n+  end)\n+\n+  scope :of_category, (lambda do |device_category_id|\n     where device_category_id: device_category_id if device_category_id.present?\n-  end\n-  scope :of_status, ->device_status_id do\n+  end)\n+\n+  scope :of_status, (lambda do |device_status_id|\n     where device_status_id: device_status_id if device_status_id.present?\n-  end\n-  scope :of_invoice, ->invoice_id do\n+  end)\n+\n+  scope :of_invoice, (lambda do |invoice_id|\n     where invoice_id: invoice_id if invoice_id.present?\n-  end\n+  end)\n \n   scope :order_by_time, ->{order created_at: :desc, updated_at: :desc}\n \n-  scope :can_assign, -> {where device_status_id: Settings.device_status.available}\n+  scope :can_assign, ->{where device_status_id: Settings.device_status.available}\n \n   scope :load_devices_with_empty_code, ->{where printed_code: nil}\n \n-  scope :load_device_structure, -> do\n+  scope :load_device_structure, (lambda do\n     joins(:device_status).joins(:device_category).select \"devices.device_code\",\n       \"devices.id\", \"devices.production_name\",\n       \"devices.device_status_id\", \"device_statuses.name as device_status_name\",\n       \"devices.device_category_id\",\"device_categories.name as device_category_name\",","path":"app/models/device.rb","position":48,"original_position":48,"commit_id":"1e2e69663f3320d39d78d673d4a572f181a05c54","original_commit_id":"1e2e69663f3320d39d78d673d4a572f181a05c54","user":{"login":"framgia-jenkins-ci","id":16641396,"avatar_url":"https://avatars3.githubusercontent.com/u/16641396?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia-jenkins-ci","html_url":"https://github.com/framgia-jenkins-ci","followers_url":"https://api.github.com/users/framgia-jenkins-ci/followers","following_url":"https://api.github.com/users/framgia-jenkins-ci/following{/other_user}","gists_url":"https://api.github.com/users/framgia-jenkins-ci/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia-jenkins-ci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia-jenkins-ci/subscriptions","organizations_url":"https://api.github.com/users/framgia-jenkins-ci/orgs","repos_url":"https://api.github.com/users/framgia-jenkins-ci/repos","events_url":"https://api.github.com/users/framgia-jenkins-ci/events{/privacy}","received_events_url":"https://api.github.com/users/framgia-jenkins-ci/received_events","type":"User","site_admin":false},"body":"**Reporter**: CHECKSTYLE\n**Rule**: com.puppycrawl.tools.checkstyle.Style/SpaceAfterComma\n**Severity**: INFO\n**File**: app/models/device.rb L64\n\nSpace missing after comma.\n\n*<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>*\n","created_at":"2017-06-12T09:11:22Z","updated_at":"2017-06-12T09:11:22Z","html_url":"https://github.com/framgia/management_devise_01/pull/188#discussion_r121343117","pull_request_url":"https://api.github.com/repos/framgia/management_devise_01/pulls/188","_links":{"self":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/comments/121343117"},"html":{"href":"https://github.com/framgia/management_devise_01/pull/188#discussion_r121343117"},"pull_request":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/188"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/management_devise_01/pulls/188","id":125071506,"html_url":"https://github.com/framgia/management_devise_01/pull/188","diff_url":"https://github.com/framgia/management_devise_01/pull/188.diff","patch_url":"https://github.com/framgia/management_devise_01/pull/188.patch","issue_url":"https://api.github.com/repos/framgia/management_devise_01/issues/188","number":188,"state":"open","locked":false,"title":"list branch and list device brorrow","user":{"login":"minhth1905","id":17795860,"avatar_url":"https://avatars3.githubusercontent.com/u/17795860?v=3","gravatar_id":"","url":"https://api.github.com/users/minhth1905","html_url":"https://github.com/minhth1905","followers_url":"https://api.github.com/users/minhth1905/followers","following_url":"https://api.github.com/users/minhth1905/following{/other_user}","gists_url":"https://api.github.com/users/minhth1905/gists{/gist_id}","starred_url":"https://api.github.com/users/minhth1905/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minhth1905/subscriptions","organizations_url":"https://api.github.com/users/minhth1905/orgs","repos_url":"https://api.github.com/users/minhth1905/repos","events_url":"https://api.github.com/users/minhth1905/events{/privacy}","received_events_url":"https://api.github.com/users/minhth1905/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-06-12T07:03:50Z","updated_at":"2017-06-12T09:11:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfceaf975196f682ca0ca72421c3fb6f9e562c9d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/management_devise_01/pulls/188/commits","review_comments_url":"https://api.github.com/repos/framgia/management_devise_01/pulls/188/comments","review_comment_url":"https://api.github.com/repos/framgia/management_devise_01/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/management_devise_01/issues/188/comments","statuses_url":"https://api.github.com/repos/framgia/management_devise_01/statuses/1e2e69663f3320d39d78d673d4a572f181a05c54","head":{"label":"minhth1905:branch-list-device","ref":"branch-list-device","sha":"1e2e69663f3320d39d78d673d4a572f181a05c54","user":{"login":"minhth1905","id":17795860,"avatar_url":"https://avatars3.githubusercontent.com/u/17795860?v=3","gravatar_id":"","url":"https://api.github.com/users/minhth1905","html_url":"https://github.com/minhth1905","followers_url":"https://api.github.com/users/minhth1905/followers","following_url":"https://api.github.com/users/minhth1905/following{/other_user}","gists_url":"https://api.github.com/users/minhth1905/gists{/gist_id}","starred_url":"https://api.github.com/users/minhth1905/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minhth1905/subscriptions","organizations_url":"https://api.github.com/users/minhth1905/orgs","repos_url":"https://api.github.com/users/minhth1905/repos","events_url":"https://api.github.com/users/minhth1905/events{/privacy}","received_events_url":"https://api.github.com/users/minhth1905/received_events","type":"User","site_admin":false},"repo":{"id":87757293,"name":"management_devise_01","full_name":"minhth1905/management_devise_01","owner":{"login":"minhth1905","id":17795860,"avatar_url":"https://avatars3.githubusercontent.com/u/17795860?v=3","gravatar_id":"","url":"https://api.github.com/users/minhth1905","html_url":"https://github.com/minhth1905","followers_url":"https://api.github.com/users/minhth1905/followers","following_url":"https://api.github.com/users/minhth1905/following{/other_user}","gists_url":"https://api.github.com/users/minhth1905/gists{/gist_id}","starred_url":"https://api.github.com/users/minhth1905/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minhth1905/subscriptions","organizations_url":"https://api.github.com/users/minhth1905/orgs","repos_url":"https://api.github.com/users/minhth1905/repos","events_url":"https://api.github.com/users/minhth1905/events{/privacy}","received_events_url":"https://api.github.com/users/minhth1905/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/minhth1905/management_devise_01","description":null,"fork":true,"url":"https://api.github.com/repos/minhth1905/management_devise_01","forks_url":"https://api.github.com/repos/minhth1905/management_devise_01/forks","keys_url":"https://api.github.com/repos/minhth1905/management_devise_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/minhth1905/management_devise_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/minhth1905/management_devise_01/teams","hooks_url":"https://api.github.com/repos/minhth1905/management_devise_01/hooks","issue_events_url":"https://api.github.com/repos/minhth1905/management_devise_01/issues/events{/number}","events_url":"https://api.github.com/repos/minhth1905/management_devise_01/events","assignees_url":"https://api.github.com/repos/minhth1905/management_devise_01/assignees{/user}","branches_url":"https://api.github.com/repos/minhth1905/management_devise_01/branches{/branch}","tags_url":"https://api.github.com/repos/minhth1905/management_devise_01/tags","blobs_url":"https://api.github.com/repos/minhth1905/management_devise_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/minhth1905/management_devise_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/minhth1905/management_devise_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/minhth1905/management_devise_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/minhth1905/management_devise_01/statuses/{sha}","languages_url":"https://api.github.com/repos/minhth1905/management_devise_01/languages","stargazers_url":"https://api.github.com/repos/minhth1905/management_devise_01/stargazers","contributors_url":"https://api.github.com/repos/minhth1905/management_devise_01/contributors","subscribers_url":"https://api.github.com/repos/minhth1905/management_devise_01/subscribers","subscription_url":"https://api.github.com/repos/minhth1905/management_devise_01/subscription","commits_url":"https://api.github.com/repos/minhth1905/management_devise_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/minhth1905/management_devise_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/minhth1905/management_devise_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/minhth1905/management_devise_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/minhth1905/management_devise_01/contents/{+path}","compare_url":"https://api.github.com/repos/minhth1905/management_devise_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/minhth1905/management_devise_01/merges","archive_url":"https://api.github.com/repos/minhth1905/management_devise_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/minhth1905/management_devise_01/downloads","issues_url":"https://api.github.com/repos/minhth1905/management_devise_01/issues{/number}","pulls_url":"https://api.github.com/repos/minhth1905/management_devise_01/pulls{/number}","milestones_url":"https://api.github.com/repos/minhth1905/management_devise_01/milestones{/number}","notifications_url":"https://api.github.com/repos/minhth1905/management_devise_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/minhth1905/management_devise_01/labels{/name}","releases_url":"https://api.github.com/repos/minhth1905/management_devise_01/releases{/id}","deployments_url":"https://api.github.com/repos/minhth1905/management_devise_01/deployments","created_at":"2017-04-10T02:23:15Z","updated_at":"2017-04-10T02:23:17Z","pushed_at":"2017-06-12T09:09:41Z","git_url":"git://github.com/minhth1905/management_devise_01.git","ssh_url":"git@github.com:minhth1905/management_devise_01.git","clone_url":"https://github.com/minhth1905/management_devise_01.git","svn_url":"https://github.com/minhth1905/management_devise_01","homepage":null,"size":2511,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"develop"}},"base":{"label":"framgia:develop","ref":"develop","sha":"8234e22f295a120251cdc26ab76792e17193b8d0","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars0.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":78728423,"name":"management_devise_01","full_name":"framgia/management_devise_01","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars0.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/management_devise_01","description":null,"fork":false,"url":"https://api.github.com/repos/framgia/management_devise_01","forks_url":"https://api.github.com/repos/framgia/management_devise_01/forks","keys_url":"https://api.github.com/repos/framgia/management_devise_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/management_devise_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/management_devise_01/teams","hooks_url":"https://api.github.com/repos/framgia/management_devise_01/hooks","issue_events_url":"https://api.github.com/repos/framgia/management_devise_01/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/management_devise_01/events","assignees_url":"https://api.github.com/repos/framgia/management_devise_01/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/management_devise_01/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/management_devise_01/tags","blobs_url":"https://api.github.com/repos/framgia/management_devise_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/management_devise_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/management_devise_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/management_devise_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/management_devise_01/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/management_devise_01/languages","stargazers_url":"https://api.github.com/repos/framgia/management_devise_01/stargazers","contributors_url":"https://api.github.com/repos/framgia/management_devise_01/contributors","subscribers_url":"https://api.github.com/repos/framgia/management_devise_01/subscribers","subscription_url":"https://api.github.com/repos/framgia/management_devise_01/subscription","commits_url":"https://api.github.com/repos/framgia/management_devise_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/management_devise_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/management_devise_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/management_devise_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/management_devise_01/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/management_devise_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/management_devise_01/merges","archive_url":"https://api.github.com/repos/framgia/management_devise_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/management_devise_01/downloads","issues_url":"https://api.github.com/repos/framgia/management_devise_01/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/management_devise_01/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/management_devise_01/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/management_devise_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/management_devise_01/labels{/name}","releases_url":"https://api.github.com/repos/framgia/management_devise_01/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/management_devise_01/deployments","created_at":"2017-01-12T09:24:48Z","updated_at":"2017-02-16T13:24:43Z","pushed_at":"2017-06-12T09:09:43Z","git_url":"git://github.com/framgia/management_devise_01.git","ssh_url":"git@github.com:framgia/management_devise_01.git","clone_url":"https://github.com/framgia/management_devise_01.git","svn_url":"https://github.com/framgia/management_devise_01","homepage":null,"size":2723,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":19,"forks":17,"open_issues":19,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/188"},"html":{"href":"https://github.com/framgia/management_devise_01/pull/188"},"issue":{"href":"https://api.github.com/repos/framgia/management_devise_01/issues/188"},"comments":{"href":"https://api.github.com/repos/framgia/management_devise_01/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/management_devise_01/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/management_devise_01/statuses/1e2e69663f3320d39d78d673d4a572f181a05c54"}}}}
{"actor":{"display_login":"framgia-jenkins-ci"}}