{"action":"created","comment":{"url":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments/55507471","id":55507471,"diff_hunk":"@@ -66,6 +36,49 @@ def merge\n     end\n   end\n \n+  def load_cameras\n+    condition = \"lower(cameras.exid) like lower('%#{params[:exid]}%') OR lower(cameras.name) like lower('%#{params[:name]}%') OR \n+      lower(vm.name) like lower('%#{params[:vmname]}%') OR lower(v.name) like lower('%#{params[:vname]}%')\n+      OR lower(users.firstname || ' ' || users.lastname) like lower('%#{params[:fullname]}%') OR \n+      lower(cameras.config->>'external_host') like lower('%#{params[:external_host]}%')\"\n+    cameras = Camera.joins(\"left JOIN users on cameras.owner_id = users.id\")\n+                    .joins(\"left JOIN vendor_models vm on cameras.model_id = vm.id\")\n+                    .joins(\"left JOIN vendors v on vm.vendor_id = v.id\")\n+                    .where(condition).order(\"cameras.created_at\").decorate\n+    total_records = cameras.count\n+    display_length = params[:length].to_i\n+    display_length = display_length < 0 ? total_records : display_length\n+    display_start = params[:start].to_i\n+    table_draw = params[:draw].to_i\n+\n+    index_end = display_start + display_length\n+    index_end = index_end > total_records ? total_records - 1 : index_end\n+    records = { data: [], draw: table_draw, recordsTotal: total_records, recordsFiltered: total_records }","path":"app/controllers/cameras_controller.rb","position":58,"original_position":58,"commit_id":"1f8294095dd9fa81aa958a7b26022020f2583faf","original_commit_id":"1f8294095dd9fa81aa958a7b26022020f2583faf","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long. [105/80]","created_at":"2016-03-09T11:51:18Z","updated_at":"2016-03-09T11:51:18Z","html_url":"https://github.com/evercam/evercam-admin/pull/153#discussion_r55507471","pull_request_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments/55507471"},"html":{"href":"https://github.com/evercam/evercam-admin/pull/153#discussion_r55507471"},"pull_request":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/evercam/evercam-admin/pulls/153","id":62217270,"html_url":"https://github.com/evercam/evercam-admin/pull/153","diff_url":"https://github.com/evercam/evercam-admin/pull/153.diff","patch_url":"https://github.com/evercam/evercam-admin/pull/153.patch","issue_url":"https://api.github.com/repos/evercam/evercam-admin/issues/153","number":153,"state":"open","locked":false,"title":"Seedup cameras page is complete","user":{"login":"ijunaidfarooq","id":13561999,"avatar_url":"https://avatars.githubusercontent.com/u/13561999?v=3","gravatar_id":"","url":"https://api.github.com/users/ijunaidfarooq","html_url":"https://github.com/ijunaidfarooq","followers_url":"https://api.github.com/users/ijunaidfarooq/followers","following_url":"https://api.github.com/users/ijunaidfarooq/following{/other_user}","gists_url":"https://api.github.com/users/ijunaidfarooq/gists{/gist_id}","starred_url":"https://api.github.com/users/ijunaidfarooq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijunaidfarooq/subscriptions","organizations_url":"https://api.github.com/users/ijunaidfarooq/orgs","repos_url":"https://api.github.com/users/ijunaidfarooq/repos","events_url":"https://api.github.com/users/ijunaidfarooq/events{/privacy}","received_events_url":"https://api.github.com/users/ijunaidfarooq/received_events","type":"User","site_admin":false},"body":"/cc @azharmalik3 ","created_at":"2016-03-09T11:50:59Z","updated_at":"2016-03-09T11:51:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf5371a3985e6c311a52e14a35e9b16b5b2b369b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/153/commits","review_comments_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/153/comments","review_comment_url":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/issues/153/comments","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/1f8294095dd9fa81aa958a7b26022020f2583faf","head":{"label":"evercam:cameras_page_speed_up","ref":"cameras_page_speed_up","sha":"1f8294095dd9fa81aa958a7b26022020f2583faf","user":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"repo":{"id":38099607,"name":"evercam-admin","full_name":"evercam/evercam-admin","owner":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evercam/evercam-admin","description":"Rails Application for Admin Area for User & Camera Management","fork":false,"url":"https://api.github.com/repos/evercam/evercam-admin","forks_url":"https://api.github.com/repos/evercam/evercam-admin/forks","keys_url":"https://api.github.com/repos/evercam/evercam-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evercam/evercam-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evercam/evercam-admin/teams","hooks_url":"https://api.github.com/repos/evercam/evercam-admin/hooks","issue_events_url":"https://api.github.com/repos/evercam/evercam-admin/issues/events{/number}","events_url":"https://api.github.com/repos/evercam/evercam-admin/events","assignees_url":"https://api.github.com/repos/evercam/evercam-admin/assignees{/user}","branches_url":"https://api.github.com/repos/evercam/evercam-admin/branches{/branch}","tags_url":"https://api.github.com/repos/evercam/evercam-admin/tags","blobs_url":"https://api.github.com/repos/evercam/evercam-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evercam/evercam-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evercam/evercam-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/evercam/evercam-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/evercam/evercam-admin/languages","stargazers_url":"https://api.github.com/repos/evercam/evercam-admin/stargazers","contributors_url":"https://api.github.com/repos/evercam/evercam-admin/contributors","subscribers_url":"https://api.github.com/repos/evercam/evercam-admin/subscribers","subscription_url":"https://api.github.com/repos/evercam/evercam-admin/subscription","commits_url":"https://api.github.com/repos/evercam/evercam-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/evercam/evercam-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/evercam/evercam-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/evercam/evercam-admin/contents/{+path}","compare_url":"https://api.github.com/repos/evercam/evercam-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evercam/evercam-admin/merges","archive_url":"https://api.github.com/repos/evercam/evercam-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evercam/evercam-admin/downloads","issues_url":"https://api.github.com/repos/evercam/evercam-admin/issues{/number}","pulls_url":"https://api.github.com/repos/evercam/evercam-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/evercam/evercam-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/evercam/evercam-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evercam/evercam-admin/labels{/name}","releases_url":"https://api.github.com/repos/evercam/evercam-admin/releases{/id}","deployments_url":"https://api.github.com/repos/evercam/evercam-admin/deployments","created_at":"2015-06-26T08:22:15Z","updated_at":"2016-01-21T13:08:29Z","pushed_at":"2016-03-09T11:51:00Z","git_url":"git://github.com/evercam/evercam-admin.git","ssh_url":"git@github.com:evercam/evercam-admin.git","clone_url":"https://github.com/evercam/evercam-admin.git","svn_url":"https://github.com/evercam/evercam-admin","homepage":null,"size":9979,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"master"}},"base":{"label":"evercam:master","ref":"master","sha":"e9246f2674c9f0a69947f94fac49601332c6efa0","user":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"repo":{"id":38099607,"name":"evercam-admin","full_name":"evercam/evercam-admin","owner":{"login":"evercam","id":5575404,"avatar_url":"https://avatars.githubusercontent.com/u/5575404?v=3","gravatar_id":"","url":"https://api.github.com/users/evercam","html_url":"https://github.com/evercam","followers_url":"https://api.github.com/users/evercam/followers","following_url":"https://api.github.com/users/evercam/following{/other_user}","gists_url":"https://api.github.com/users/evercam/gists{/gist_id}","starred_url":"https://api.github.com/users/evercam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evercam/subscriptions","organizations_url":"https://api.github.com/users/evercam/orgs","repos_url":"https://api.github.com/users/evercam/repos","events_url":"https://api.github.com/users/evercam/events{/privacy}","received_events_url":"https://api.github.com/users/evercam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/evercam/evercam-admin","description":"Rails Application for Admin Area for User & Camera Management","fork":false,"url":"https://api.github.com/repos/evercam/evercam-admin","forks_url":"https://api.github.com/repos/evercam/evercam-admin/forks","keys_url":"https://api.github.com/repos/evercam/evercam-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evercam/evercam-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evercam/evercam-admin/teams","hooks_url":"https://api.github.com/repos/evercam/evercam-admin/hooks","issue_events_url":"https://api.github.com/repos/evercam/evercam-admin/issues/events{/number}","events_url":"https://api.github.com/repos/evercam/evercam-admin/events","assignees_url":"https://api.github.com/repos/evercam/evercam-admin/assignees{/user}","branches_url":"https://api.github.com/repos/evercam/evercam-admin/branches{/branch}","tags_url":"https://api.github.com/repos/evercam/evercam-admin/tags","blobs_url":"https://api.github.com/repos/evercam/evercam-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evercam/evercam-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evercam/evercam-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/evercam/evercam-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evercam/evercam-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/evercam/evercam-admin/languages","stargazers_url":"https://api.github.com/repos/evercam/evercam-admin/stargazers","contributors_url":"https://api.github.com/repos/evercam/evercam-admin/contributors","subscribers_url":"https://api.github.com/repos/evercam/evercam-admin/subscribers","subscription_url":"https://api.github.com/repos/evercam/evercam-admin/subscription","commits_url":"https://api.github.com/repos/evercam/evercam-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/evercam/evercam-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/evercam/evercam-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/evercam/evercam-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/evercam/evercam-admin/contents/{+path}","compare_url":"https://api.github.com/repos/evercam/evercam-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evercam/evercam-admin/merges","archive_url":"https://api.github.com/repos/evercam/evercam-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evercam/evercam-admin/downloads","issues_url":"https://api.github.com/repos/evercam/evercam-admin/issues{/number}","pulls_url":"https://api.github.com/repos/evercam/evercam-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/evercam/evercam-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/evercam/evercam-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evercam/evercam-admin/labels{/name}","releases_url":"https://api.github.com/repos/evercam/evercam-admin/releases{/id}","deployments_url":"https://api.github.com/repos/evercam/evercam-admin/deployments","created_at":"2015-06-26T08:22:15Z","updated_at":"2016-01-21T13:08:29Z","pushed_at":"2016-03-09T11:51:00Z","git_url":"git://github.com/evercam/evercam-admin.git","ssh_url":"git@github.com:evercam/evercam-admin.git","clone_url":"https://github.com/evercam/evercam-admin.git","svn_url":"https://github.com/evercam/evercam-admin","homepage":null,"size":9979,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/153"},"html":{"href":"https://github.com/evercam/evercam-admin/pull/153"},"issue":{"href":"https://api.github.com/repos/evercam/evercam-admin/issues/153"},"comments":{"href":"https://api.github.com/repos/evercam/evercam-admin/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/evercam/evercam-admin/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/evercam/evercam-admin/statuses/1f8294095dd9fa81aa958a7b26022020f2583faf"}}}}