{"action":"created","comment":{"url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/comments/45174379","id":45174379,"diff_hunk":"@@ -260,17 +260,35 @@ Model.prototype.where = function(condition) {\n  * @param [withJson]\n  * @returns {*}\n  */\n-Model.prototype.findById = function(_id, callback, withJson) {\n+Model.prototype.findById = function (_id, callback, withJson) {\n     var id = _id;\n-    if(this.primaryKeys.length === 1 && typeof _id !== \"object\") {\n+    var self = this;\n+    if (this.primaryKeys.length === 1 && typeof _id !== \"object\") {\n         id = {};\n         id[this.primaryKeys[0].name] = _id;\n     }\n \n-    if(typeof id !== \"object\") {\n+    if (typeof id !== \"object\") {\n         return callback(new Error(\"You should pass a valid IDs object.\"));\n     }\n \n+    if (this.cache) {\n+        return cache.getData(this.toshihiko.database, this.name, id, function (err, data) {\n+            if (err) {\n+                data = []","path":"lib/model.js","position":22,"original_position":22,"commit_id":"f16b1c886b046d648f2200d0fa998d5b36c1ef77","original_commit_id":"f16b1c886b046d648f2200d0fa998d5b36c1ef77","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":"Missing semicolon.","created_at":"2015-11-18T09:04:49Z","updated_at":"2015-11-18T09:04:49Z","html_url":"https://github.com/XadillaX/Toshihiko/pull/29#discussion_r45174379","pull_request_url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/comments/45174379"},"html":{"href":"https://github.com/XadillaX/Toshihiko/pull/29#discussion_r45174379"},"pull_request":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29","id":51057999,"html_url":"https://github.com/XadillaX/Toshihiko/pull/29","diff_url":"https://github.com/XadillaX/Toshihiko/pull/29.diff","patch_url":"https://github.com/XadillaX/Toshihiko/pull/29.patch","issue_url":"https://api.github.com/repos/XadillaX/Toshihiko/issues/29","number":29,"state":"open","locked":false,"title":"improve-findById","user":{"login":"luicfer","id":8154651,"avatar_url":"https://avatars.githubusercontent.com/u/8154651?v=3","gravatar_id":"","url":"https://api.github.com/users/luicfer","html_url":"https://github.com/luicfer","followers_url":"https://api.github.com/users/luicfer/followers","following_url":"https://api.github.com/users/luicfer/following{/other_user}","gists_url":"https://api.github.com/users/luicfer/gists{/gist_id}","starred_url":"https://api.github.com/users/luicfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luicfer/subscriptions","organizations_url":"https://api.github.com/users/luicfer/orgs","repos_url":"https://api.github.com/users/luicfer/repos","events_url":"https://api.github.com/users/luicfer/events{/privacy}","received_events_url":"https://api.github.com/users/luicfer/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-18T09:04:43Z","updated_at":"2015-11-18T09:04:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"170f4bd440f4f0a90aad0f9d79444a2696da6251","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29/commits","review_comments_url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29/comments","review_comment_url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/comments{/number}","comments_url":"https://api.github.com/repos/XadillaX/Toshihiko/issues/29/comments","statuses_url":"https://api.github.com/repos/XadillaX/Toshihiko/statuses/f16b1c886b046d648f2200d0fa998d5b36c1ef77","head":{"label":"luicfer:feature/Improve-findById","ref":"feature/Improve-findById","sha":"f16b1c886b046d648f2200d0fa998d5b36c1ef77","user":{"login":"luicfer","id":8154651,"avatar_url":"https://avatars.githubusercontent.com/u/8154651?v=3","gravatar_id":"","url":"https://api.github.com/users/luicfer","html_url":"https://github.com/luicfer","followers_url":"https://api.github.com/users/luicfer/followers","following_url":"https://api.github.com/users/luicfer/following{/other_user}","gists_url":"https://api.github.com/users/luicfer/gists{/gist_id}","starred_url":"https://api.github.com/users/luicfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luicfer/subscriptions","organizations_url":"https://api.github.com/users/luicfer/orgs","repos_url":"https://api.github.com/users/luicfer/repos","events_url":"https://api.github.com/users/luicfer/events{/privacy}","received_events_url":"https://api.github.com/users/luicfer/received_events","type":"User","site_admin":false},"repo":{"id":46403213,"name":"Toshihiko","full_name":"luicfer/Toshihiko","owner":{"login":"luicfer","id":8154651,"avatar_url":"https://avatars.githubusercontent.com/u/8154651?v=3","gravatar_id":"","url":"https://api.github.com/users/luicfer","html_url":"https://github.com/luicfer","followers_url":"https://api.github.com/users/luicfer/followers","following_url":"https://api.github.com/users/luicfer/following{/other_user}","gists_url":"https://api.github.com/users/luicfer/gists{/gist_id}","starred_url":"https://api.github.com/users/luicfer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luicfer/subscriptions","organizations_url":"https://api.github.com/users/luicfer/orgs","repos_url":"https://api.github.com/users/luicfer/repos","events_url":"https://api.github.com/users/luicfer/events{/privacy}","received_events_url":"https://api.github.com/users/luicfer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luicfer/Toshihiko","description":"A simple ORM for node.js in souche.com.","fork":true,"url":"https://api.github.com/repos/luicfer/Toshihiko","forks_url":"https://api.github.com/repos/luicfer/Toshihiko/forks","keys_url":"https://api.github.com/repos/luicfer/Toshihiko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luicfer/Toshihiko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luicfer/Toshihiko/teams","hooks_url":"https://api.github.com/repos/luicfer/Toshihiko/hooks","issue_events_url":"https://api.github.com/repos/luicfer/Toshihiko/issues/events{/number}","events_url":"https://api.github.com/repos/luicfer/Toshihiko/events","assignees_url":"https://api.github.com/repos/luicfer/Toshihiko/assignees{/user}","branches_url":"https://api.github.com/repos/luicfer/Toshihiko/branches{/branch}","tags_url":"https://api.github.com/repos/luicfer/Toshihiko/tags","blobs_url":"https://api.github.com/repos/luicfer/Toshihiko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luicfer/Toshihiko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luicfer/Toshihiko/git/refs{/sha}","trees_url":"https://api.github.com/repos/luicfer/Toshihiko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luicfer/Toshihiko/statuses/{sha}","languages_url":"https://api.github.com/repos/luicfer/Toshihiko/languages","stargazers_url":"https://api.github.com/repos/luicfer/Toshihiko/stargazers","contributors_url":"https://api.github.com/repos/luicfer/Toshihiko/contributors","subscribers_url":"https://api.github.com/repos/luicfer/Toshihiko/subscribers","subscription_url":"https://api.github.com/repos/luicfer/Toshihiko/subscription","commits_url":"https://api.github.com/repos/luicfer/Toshihiko/commits{/sha}","git_commits_url":"https://api.github.com/repos/luicfer/Toshihiko/git/commits{/sha}","comments_url":"https://api.github.com/repos/luicfer/Toshihiko/comments{/number}","issue_comment_url":"https://api.github.com/repos/luicfer/Toshihiko/issues/comments{/number}","contents_url":"https://api.github.com/repos/luicfer/Toshihiko/contents/{+path}","compare_url":"https://api.github.com/repos/luicfer/Toshihiko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luicfer/Toshihiko/merges","archive_url":"https://api.github.com/repos/luicfer/Toshihiko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luicfer/Toshihiko/downloads","issues_url":"https://api.github.com/repos/luicfer/Toshihiko/issues{/number}","pulls_url":"https://api.github.com/repos/luicfer/Toshihiko/pulls{/number}","milestones_url":"https://api.github.com/repos/luicfer/Toshihiko/milestones{/number}","notifications_url":"https://api.github.com/repos/luicfer/Toshihiko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luicfer/Toshihiko/labels{/name}","releases_url":"https://api.github.com/repos/luicfer/Toshihiko/releases{/id}","created_at":"2015-11-18T07:41:29Z","updated_at":"2015-11-18T07:41:30Z","pushed_at":"2015-11-18T09:04:26Z","git_url":"git://github.com/luicfer/Toshihiko.git","ssh_url":"git@github.com:luicfer/Toshihiko.git","clone_url":"https://github.com/luicfer/Toshihiko.git","svn_url":"https://github.com/luicfer/Toshihiko","homepage":"http://souche.com/","size":264,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"XadillaX:develop","ref":"develop","sha":"9af749e317d71fe0da04cc15353fc0193022d045","user":{"login":"XadillaX","id":2842176,"avatar_url":"https://avatars.githubusercontent.com/u/2842176?v=3","gravatar_id":"","url":"https://api.github.com/users/XadillaX","html_url":"https://github.com/XadillaX","followers_url":"https://api.github.com/users/XadillaX/followers","following_url":"https://api.github.com/users/XadillaX/following{/other_user}","gists_url":"https://api.github.com/users/XadillaX/gists{/gist_id}","starred_url":"https://api.github.com/users/XadillaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XadillaX/subscriptions","organizations_url":"https://api.github.com/users/XadillaX/orgs","repos_url":"https://api.github.com/users/XadillaX/repos","events_url":"https://api.github.com/users/XadillaX/events{/privacy}","received_events_url":"https://api.github.com/users/XadillaX/received_events","type":"User","site_admin":false},"repo":{"id":23830374,"name":"Toshihiko","full_name":"XadillaX/Toshihiko","owner":{"login":"XadillaX","id":2842176,"avatar_url":"https://avatars.githubusercontent.com/u/2842176?v=3","gravatar_id":"","url":"https://api.github.com/users/XadillaX","html_url":"https://github.com/XadillaX","followers_url":"https://api.github.com/users/XadillaX/followers","following_url":"https://api.github.com/users/XadillaX/following{/other_user}","gists_url":"https://api.github.com/users/XadillaX/gists{/gist_id}","starred_url":"https://api.github.com/users/XadillaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XadillaX/subscriptions","organizations_url":"https://api.github.com/users/XadillaX/orgs","repos_url":"https://api.github.com/users/XadillaX/repos","events_url":"https://api.github.com/users/XadillaX/events{/privacy}","received_events_url":"https://api.github.com/users/XadillaX/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XadillaX/Toshihiko","description":"A simple ORM for node.js in souche.com.","fork":false,"url":"https://api.github.com/repos/XadillaX/Toshihiko","forks_url":"https://api.github.com/repos/XadillaX/Toshihiko/forks","keys_url":"https://api.github.com/repos/XadillaX/Toshihiko/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XadillaX/Toshihiko/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XadillaX/Toshihiko/teams","hooks_url":"https://api.github.com/repos/XadillaX/Toshihiko/hooks","issue_events_url":"https://api.github.com/repos/XadillaX/Toshihiko/issues/events{/number}","events_url":"https://api.github.com/repos/XadillaX/Toshihiko/events","assignees_url":"https://api.github.com/repos/XadillaX/Toshihiko/assignees{/user}","branches_url":"https://api.github.com/repos/XadillaX/Toshihiko/branches{/branch}","tags_url":"https://api.github.com/repos/XadillaX/Toshihiko/tags","blobs_url":"https://api.github.com/repos/XadillaX/Toshihiko/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XadillaX/Toshihiko/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XadillaX/Toshihiko/git/refs{/sha}","trees_url":"https://api.github.com/repos/XadillaX/Toshihiko/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XadillaX/Toshihiko/statuses/{sha}","languages_url":"https://api.github.com/repos/XadillaX/Toshihiko/languages","stargazers_url":"https://api.github.com/repos/XadillaX/Toshihiko/stargazers","contributors_url":"https://api.github.com/repos/XadillaX/Toshihiko/contributors","subscribers_url":"https://api.github.com/repos/XadillaX/Toshihiko/subscribers","subscription_url":"https://api.github.com/repos/XadillaX/Toshihiko/subscription","commits_url":"https://api.github.com/repos/XadillaX/Toshihiko/commits{/sha}","git_commits_url":"https://api.github.com/repos/XadillaX/Toshihiko/git/commits{/sha}","comments_url":"https://api.github.com/repos/XadillaX/Toshihiko/comments{/number}","issue_comment_url":"https://api.github.com/repos/XadillaX/Toshihiko/issues/comments{/number}","contents_url":"https://api.github.com/repos/XadillaX/Toshihiko/contents/{+path}","compare_url":"https://api.github.com/repos/XadillaX/Toshihiko/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XadillaX/Toshihiko/merges","archive_url":"https://api.github.com/repos/XadillaX/Toshihiko/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XadillaX/Toshihiko/downloads","issues_url":"https://api.github.com/repos/XadillaX/Toshihiko/issues{/number}","pulls_url":"https://api.github.com/repos/XadillaX/Toshihiko/pulls{/number}","milestones_url":"https://api.github.com/repos/XadillaX/Toshihiko/milestones{/number}","notifications_url":"https://api.github.com/repos/XadillaX/Toshihiko/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XadillaX/Toshihiko/labels{/name}","releases_url":"https://api.github.com/repos/XadillaX/Toshihiko/releases{/id}","created_at":"2014-09-09T11:16:16Z","updated_at":"2015-11-03T01:06:54Z","pushed_at":"2015-11-18T09:04:44Z","git_url":"git://github.com/XadillaX/Toshihiko.git","ssh_url":"git@github.com:XadillaX/Toshihiko.git","clone_url":"https://github.com/XadillaX/Toshihiko.git","svn_url":"https://github.com/XadillaX/Toshihiko","homepage":"http://souche.com/","size":1145,"stargazers_count":83,"watchers_count":83,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":2,"forks":13,"open_issues":2,"watchers":83,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29"},"html":{"href":"https://github.com/XadillaX/Toshihiko/pull/29"},"issue":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/issues/29"},"comments":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/XadillaX/Toshihiko/statuses/f16b1c886b046d648f2200d0fa998d5b36c1ef77"}}}}