{"action":"created","comment":{"url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/comments/38877328","id":38877328,"diff_hunk":"@@ -0,0 +1,21 @@\n+class Manager < ActiveRecord::Base\n+  before_save :ensure_authentication_token\n+  # Include default devise modules. Others available are:\n+  # :confirmable, :lockable, :timeoutable and :omniauthable\n+  devise :database_authenticatable, :registerable,\n+         :recoverable, :rememberable, :trackable, :validatable\n+  \n+  def ensure_authentication_token\n+    if authentication_token.blank?\n+      self.authentication_token = generate_authentication_token\n+    end\n+  end\n+\n+  private\n+    def generate_authentication_token\n+      loop do\n+        token = Devise.friendly_token\n+        break token unless User.where(authentication_token: token).first","path":"app/models/manager.rb","position":null,"original_position":18,"commit_id":"136bfc785c7ac44d3a1458eaa69c210f4e694708","original_commit_id":"448dfa00343f42f5a7e0c6602ae2936af034326d","user":{"login":"gwmoura","id":1118305,"avatar_url":"https://avatars.githubusercontent.com/u/1118305?v=3","gravatar_id":"","url":"https://api.github.com/users/gwmoura","html_url":"https://github.com/gwmoura","followers_url":"https://api.github.com/users/gwmoura/followers","following_url":"https://api.github.com/users/gwmoura/following{/other_user}","gists_url":"https://api.github.com/users/gwmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/gwmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwmoura/subscriptions","organizations_url":"https://api.github.com/users/gwmoura/orgs","repos_url":"https://api.github.com/users/gwmoura/repos","events_url":"https://api.github.com/users/gwmoura/events{/privacy}","received_events_url":"https://api.github.com/users/gwmoura/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2015-09-07T19:13:27Z","updated_at":"2015-09-07T19:13:27Z","html_url":"https://github.com/railsblocks/railsblocks-auth/pull/1#discussion_r38877328","pull_request_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/comments/38877328"},"html":{"href":"https://github.com/railsblocks/railsblocks-auth/pull/1#discussion_r38877328"},"pull_request":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1","id":44314699,"html_url":"https://github.com/railsblocks/railsblocks-auth/pull/1","diff_url":"https://github.com/railsblocks/railsblocks-auth/pull/1.diff","patch_url":"https://github.com/railsblocks/railsblocks-auth/pull/1.patch","issue_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/1","number":1,"state":"open","locked":false,"title":"Add 3 Scopes, Devise and fix engine","user":{"login":"gwmoura","id":1118305,"avatar_url":"https://avatars.githubusercontent.com/u/1118305?v=3","gravatar_id":"","url":"https://api.github.com/users/gwmoura","html_url":"https://github.com/gwmoura","followers_url":"https://api.github.com/users/gwmoura/followers","following_url":"https://api.github.com/users/gwmoura/following{/other_user}","gists_url":"https://api.github.com/users/gwmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/gwmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwmoura/subscriptions","organizations_url":"https://api.github.com/users/gwmoura/orgs","repos_url":"https://api.github.com/users/gwmoura/repos","events_url":"https://api.github.com/users/gwmoura/events{/privacy}","received_events_url":"https://api.github.com/users/gwmoura/received_events","type":"User","site_admin":false},"body":"* Fix engine removing `lib/railsblocks/auth.rb` and adding `lib/railsblocks-auth.rb`\r\n* Add gem 'devise'\r\n* Add scopes:\r\n  * User\r\n  * Admin\r\n  * Manager\r\n* Add one test for each scope\r\n","created_at":"2015-09-07T01:55:06Z","updated_at":"2015-09-07T19:13:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04d518e5804e22d79b4a3cf93dbef8a5ef1fc4d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1/commits","review_comments_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1/comments","review_comment_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/1/comments","statuses_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/statuses/136bfc785c7ac44d3a1458eaa69c210f4e694708","head":{"label":"gwmoura:scopes","ref":"scopes","sha":"136bfc785c7ac44d3a1458eaa69c210f4e694708","user":{"login":"gwmoura","id":1118305,"avatar_url":"https://avatars.githubusercontent.com/u/1118305?v=3","gravatar_id":"","url":"https://api.github.com/users/gwmoura","html_url":"https://github.com/gwmoura","followers_url":"https://api.github.com/users/gwmoura/followers","following_url":"https://api.github.com/users/gwmoura/following{/other_user}","gists_url":"https://api.github.com/users/gwmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/gwmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwmoura/subscriptions","organizations_url":"https://api.github.com/users/gwmoura/orgs","repos_url":"https://api.github.com/users/gwmoura/repos","events_url":"https://api.github.com/users/gwmoura/events{/privacy}","received_events_url":"https://api.github.com/users/gwmoura/received_events","type":"User","site_admin":false},"repo":{"id":41680463,"name":"railsblocks-auth","full_name":"gwmoura/railsblocks-auth","owner":{"login":"gwmoura","id":1118305,"avatar_url":"https://avatars.githubusercontent.com/u/1118305?v=3","gravatar_id":"","url":"https://api.github.com/users/gwmoura","html_url":"https://github.com/gwmoura","followers_url":"https://api.github.com/users/gwmoura/followers","following_url":"https://api.github.com/users/gwmoura/following{/other_user}","gists_url":"https://api.github.com/users/gwmoura/gists{/gist_id}","starred_url":"https://api.github.com/users/gwmoura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwmoura/subscriptions","organizations_url":"https://api.github.com/users/gwmoura/orgs","repos_url":"https://api.github.com/users/gwmoura/repos","events_url":"https://api.github.com/users/gwmoura/events{/privacy}","received_events_url":"https://api.github.com/users/gwmoura/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gwmoura/railsblocks-auth","description":"Authentication","fork":true,"url":"https://api.github.com/repos/gwmoura/railsblocks-auth","forks_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/forks","keys_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/teams","hooks_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/hooks","issue_events_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/issues/events{/number}","events_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/events","assignees_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/assignees{/user}","branches_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/branches{/branch}","tags_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/tags","blobs_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/languages","stargazers_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/stargazers","contributors_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/contributors","subscribers_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/subscribers","subscription_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/subscription","commits_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/contents/{+path}","compare_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/merges","archive_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/downloads","issues_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/issues{/number}","pulls_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/labels{/name}","releases_url":"https://api.github.com/repos/gwmoura/railsblocks-auth/releases{/id}","created_at":"2015-08-31T14:36:59Z","updated_at":"2015-08-31T14:36:59Z","pushed_at":"2015-09-07T19:00:14Z","git_url":"git://github.com/gwmoura/railsblocks-auth.git","ssh_url":"git@github.com:gwmoura/railsblocks-auth.git","clone_url":"https://github.com/gwmoura/railsblocks-auth.git","svn_url":"https://github.com/gwmoura/railsblocks-auth","homepage":null,"size":96,"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":"railsblocks:master","ref":"master","sha":"02f8e846de62f35522eda6c8f1b58bbff532a524","user":{"login":"railsblocks","id":10852986,"avatar_url":"https://avatars.githubusercontent.com/u/10852986?v=3","gravatar_id":"","url":"https://api.github.com/users/railsblocks","html_url":"https://github.com/railsblocks","followers_url":"https://api.github.com/users/railsblocks/followers","following_url":"https://api.github.com/users/railsblocks/following{/other_user}","gists_url":"https://api.github.com/users/railsblocks/gists{/gist_id}","starred_url":"https://api.github.com/users/railsblocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railsblocks/subscriptions","organizations_url":"https://api.github.com/users/railsblocks/orgs","repos_url":"https://api.github.com/users/railsblocks/repos","events_url":"https://api.github.com/users/railsblocks/events{/privacy}","received_events_url":"https://api.github.com/users/railsblocks/received_events","type":"Organization","site_admin":false},"repo":{"id":41170873,"name":"railsblocks-auth","full_name":"railsblocks/railsblocks-auth","owner":{"login":"railsblocks","id":10852986,"avatar_url":"https://avatars.githubusercontent.com/u/10852986?v=3","gravatar_id":"","url":"https://api.github.com/users/railsblocks","html_url":"https://github.com/railsblocks","followers_url":"https://api.github.com/users/railsblocks/followers","following_url":"https://api.github.com/users/railsblocks/following{/other_user}","gists_url":"https://api.github.com/users/railsblocks/gists{/gist_id}","starred_url":"https://api.github.com/users/railsblocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/railsblocks/subscriptions","organizations_url":"https://api.github.com/users/railsblocks/orgs","repos_url":"https://api.github.com/users/railsblocks/repos","events_url":"https://api.github.com/users/railsblocks/events{/privacy}","received_events_url":"https://api.github.com/users/railsblocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/railsblocks/railsblocks-auth","description":"Authentication","fork":false,"url":"https://api.github.com/repos/railsblocks/railsblocks-auth","forks_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/forks","keys_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/teams","hooks_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/hooks","issue_events_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/events{/number}","events_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/events","assignees_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/assignees{/user}","branches_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/branches{/branch}","tags_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/tags","blobs_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/git/refs{/sha}","trees_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/statuses/{sha}","languages_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/languages","stargazers_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/stargazers","contributors_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/contributors","subscribers_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/subscribers","subscription_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/subscription","commits_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/commits{/sha}","git_commits_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/git/commits{/sha}","comments_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/comments{/number}","issue_comment_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/comments{/number}","contents_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/contents/{+path}","compare_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/merges","archive_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/downloads","issues_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues{/number}","pulls_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls{/number}","milestones_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/milestones{/number}","notifications_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/labels{/name}","releases_url":"https://api.github.com/repos/railsblocks/railsblocks-auth/releases{/id}","created_at":"2015-08-21T18:23:17Z","updated_at":"2015-08-21T18:23:26Z","pushed_at":"2015-09-07T19:00:14Z","git_url":"git://github.com/railsblocks/railsblocks-auth.git","ssh_url":"git@github.com:railsblocks/railsblocks-auth.git","clone_url":"https://github.com/railsblocks/railsblocks-auth.git","svn_url":"https://github.com/railsblocks/railsblocks-auth","homepage":null,"size":105,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1"},"html":{"href":"https://github.com/railsblocks/railsblocks-auth/pull/1"},"issue":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/1"},"comments":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/railsblocks/railsblocks-auth/statuses/136bfc785c7ac44d3a1458eaa69c210f4e694708"}}}}