{"action":"created","comment":{"url":"https://api.github.com/repos/margaretoti/library-network/pulls/comments/111983298","pull_request_review_id":33263641,"id":111983298,"diff_hunk":"@@ -10,4 +11,11 @@ class Checkout < ApplicationRecord\n   def due_date\n     self.created_at + CHECKOUT_PERIOD_IN_DAYS.days\n   end\n+\n+  def fine\n+    days_overdue = (Time.zone.now - self.due_date).to_i/1.day\n+    if days_overdue > 0","path":"app/models/checkout.rb","position":14,"original_position":14,"commit_id":"07c1e8d2826d77934a8d6a3f57b875e94ee62db7","original_commit_id":"07c1e8d2826d77934a8d6a3f57b875e94ee62db7","user":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"body":"Hi @derekprior, I originally refrained from returning 0 because I did not want the view cluttered with $0.00 for books that had no fine. However, that/you raise(s) a good point that the logic to display how the information looks should live in the view, and not be the concern of the model methods. I now return 0 if the book is not overdue. ","created_at":"2017-04-18T15:21:30Z","updated_at":"2017-04-18T15:21:30Z","html_url":"https://github.com/margaretoti/library-network/pull/11#discussion_r111983298","pull_request_url":"https://api.github.com/repos/margaretoti/library-network/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/comments/111983298"},"html":{"href":"https://github.com/margaretoti/library-network/pull/11#discussion_r111983298"},"pull_request":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/margaretoti/library-network/pulls/11","id":116212802,"html_url":"https://github.com/margaretoti/library-network/pull/11","diff_url":"https://github.com/margaretoti/library-network/pull/11.diff","patch_url":"https://github.com/margaretoti/library-network/pull/11.patch","issue_url":"https://api.github.com/repos/margaretoti/library-network/issues/11","number":11,"state":"open","locked":false,"title":"Fines for overdue books display on user profile","user":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"body":"A fine of 10 cents per day is now applied to books that are overdue. Use's can see the fine amounts for individual overdue books and the total fine owed across all books in their user profiles. \r\n\r\n![screen shot 2017-04-17 at 5 46 52 pm](https://cloud.githubusercontent.com/assets/9501674/25106116/e2b9a846-2395-11e7-87cb-bdd56594d680.png)\r\n\r\n","created_at":"2017-04-17T22:05:55Z","updated_at":"2017-04-18T15:21:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"226e79a61fc11d90a882f4cfdb158f809d51a6ae","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/margaretoti/library-network/pulls/11/commits","review_comments_url":"https://api.github.com/repos/margaretoti/library-network/pulls/11/comments","review_comment_url":"https://api.github.com/repos/margaretoti/library-network/pulls/comments{/number}","comments_url":"https://api.github.com/repos/margaretoti/library-network/issues/11/comments","statuses_url":"https://api.github.com/repos/margaretoti/library-network/statuses/07c1e8d2826d77934a8d6a3f57b875e94ee62db7","head":{"label":"margaretoti:mo-overdue-book-fines","ref":"mo-overdue-book-fines","sha":"07c1e8d2826d77934a8d6a3f57b875e94ee62db7","user":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"repo":{"id":85720249,"name":"library-network","full_name":"margaretoti/library-network","owner":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/margaretoti/library-network","description":"Enjoy most of the functionality of your local library. Patrons can check out books and request books from other libraries in network. Admins can manage inventory by adding, editing, and deleting books. ","fork":false,"url":"https://api.github.com/repos/margaretoti/library-network","forks_url":"https://api.github.com/repos/margaretoti/library-network/forks","keys_url":"https://api.github.com/repos/margaretoti/library-network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/margaretoti/library-network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/margaretoti/library-network/teams","hooks_url":"https://api.github.com/repos/margaretoti/library-network/hooks","issue_events_url":"https://api.github.com/repos/margaretoti/library-network/issues/events{/number}","events_url":"https://api.github.com/repos/margaretoti/library-network/events","assignees_url":"https://api.github.com/repos/margaretoti/library-network/assignees{/user}","branches_url":"https://api.github.com/repos/margaretoti/library-network/branches{/branch}","tags_url":"https://api.github.com/repos/margaretoti/library-network/tags","blobs_url":"https://api.github.com/repos/margaretoti/library-network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/margaretoti/library-network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/margaretoti/library-network/git/refs{/sha}","trees_url":"https://api.github.com/repos/margaretoti/library-network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/margaretoti/library-network/statuses/{sha}","languages_url":"https://api.github.com/repos/margaretoti/library-network/languages","stargazers_url":"https://api.github.com/repos/margaretoti/library-network/stargazers","contributors_url":"https://api.github.com/repos/margaretoti/library-network/contributors","subscribers_url":"https://api.github.com/repos/margaretoti/library-network/subscribers","subscription_url":"https://api.github.com/repos/margaretoti/library-network/subscription","commits_url":"https://api.github.com/repos/margaretoti/library-network/commits{/sha}","git_commits_url":"https://api.github.com/repos/margaretoti/library-network/git/commits{/sha}","comments_url":"https://api.github.com/repos/margaretoti/library-network/comments{/number}","issue_comment_url":"https://api.github.com/repos/margaretoti/library-network/issues/comments{/number}","contents_url":"https://api.github.com/repos/margaretoti/library-network/contents/{+path}","compare_url":"https://api.github.com/repos/margaretoti/library-network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/margaretoti/library-network/merges","archive_url":"https://api.github.com/repos/margaretoti/library-network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/margaretoti/library-network/downloads","issues_url":"https://api.github.com/repos/margaretoti/library-network/issues{/number}","pulls_url":"https://api.github.com/repos/margaretoti/library-network/pulls{/number}","milestones_url":"https://api.github.com/repos/margaretoti/library-network/milestones{/number}","notifications_url":"https://api.github.com/repos/margaretoti/library-network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/margaretoti/library-network/labels{/name}","releases_url":"https://api.github.com/repos/margaretoti/library-network/releases{/id}","deployments_url":"https://api.github.com/repos/margaretoti/library-network/deployments","created_at":"2017-03-21T15:39:21Z","updated_at":"2017-04-14T18:21:26Z","pushed_at":"2017-04-17T22:05:56Z","git_url":"git://github.com/margaretoti/library-network.git","ssh_url":"git@github.com:margaretoti/library-network.git","clone_url":"https://github.com/margaretoti/library-network.git","svn_url":"https://github.com/margaretoti/library-network","homepage":"","size":107,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"margaretoti:master","ref":"master","sha":"ddc6a0fc47bb4610b0da268509662e8fcf072ff0","user":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"repo":{"id":85720249,"name":"library-network","full_name":"margaretoti/library-network","owner":{"login":"margaretoti","id":9501674,"avatar_url":"https://avatars1.githubusercontent.com/u/9501674?v=3","gravatar_id":"","url":"https://api.github.com/users/margaretoti","html_url":"https://github.com/margaretoti","followers_url":"https://api.github.com/users/margaretoti/followers","following_url":"https://api.github.com/users/margaretoti/following{/other_user}","gists_url":"https://api.github.com/users/margaretoti/gists{/gist_id}","starred_url":"https://api.github.com/users/margaretoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/margaretoti/subscriptions","organizations_url":"https://api.github.com/users/margaretoti/orgs","repos_url":"https://api.github.com/users/margaretoti/repos","events_url":"https://api.github.com/users/margaretoti/events{/privacy}","received_events_url":"https://api.github.com/users/margaretoti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/margaretoti/library-network","description":"Enjoy most of the functionality of your local library. Patrons can check out books and request books from other libraries in network. Admins can manage inventory by adding, editing, and deleting books. ","fork":false,"url":"https://api.github.com/repos/margaretoti/library-network","forks_url":"https://api.github.com/repos/margaretoti/library-network/forks","keys_url":"https://api.github.com/repos/margaretoti/library-network/keys{/key_id}","collaborators_url":"https://api.github.com/repos/margaretoti/library-network/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/margaretoti/library-network/teams","hooks_url":"https://api.github.com/repos/margaretoti/library-network/hooks","issue_events_url":"https://api.github.com/repos/margaretoti/library-network/issues/events{/number}","events_url":"https://api.github.com/repos/margaretoti/library-network/events","assignees_url":"https://api.github.com/repos/margaretoti/library-network/assignees{/user}","branches_url":"https://api.github.com/repos/margaretoti/library-network/branches{/branch}","tags_url":"https://api.github.com/repos/margaretoti/library-network/tags","blobs_url":"https://api.github.com/repos/margaretoti/library-network/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/margaretoti/library-network/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/margaretoti/library-network/git/refs{/sha}","trees_url":"https://api.github.com/repos/margaretoti/library-network/git/trees{/sha}","statuses_url":"https://api.github.com/repos/margaretoti/library-network/statuses/{sha}","languages_url":"https://api.github.com/repos/margaretoti/library-network/languages","stargazers_url":"https://api.github.com/repos/margaretoti/library-network/stargazers","contributors_url":"https://api.github.com/repos/margaretoti/library-network/contributors","subscribers_url":"https://api.github.com/repos/margaretoti/library-network/subscribers","subscription_url":"https://api.github.com/repos/margaretoti/library-network/subscription","commits_url":"https://api.github.com/repos/margaretoti/library-network/commits{/sha}","git_commits_url":"https://api.github.com/repos/margaretoti/library-network/git/commits{/sha}","comments_url":"https://api.github.com/repos/margaretoti/library-network/comments{/number}","issue_comment_url":"https://api.github.com/repos/margaretoti/library-network/issues/comments{/number}","contents_url":"https://api.github.com/repos/margaretoti/library-network/contents/{+path}","compare_url":"https://api.github.com/repos/margaretoti/library-network/compare/{base}...{head}","merges_url":"https://api.github.com/repos/margaretoti/library-network/merges","archive_url":"https://api.github.com/repos/margaretoti/library-network/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/margaretoti/library-network/downloads","issues_url":"https://api.github.com/repos/margaretoti/library-network/issues{/number}","pulls_url":"https://api.github.com/repos/margaretoti/library-network/pulls{/number}","milestones_url":"https://api.github.com/repos/margaretoti/library-network/milestones{/number}","notifications_url":"https://api.github.com/repos/margaretoti/library-network/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/margaretoti/library-network/labels{/name}","releases_url":"https://api.github.com/repos/margaretoti/library-network/releases{/id}","deployments_url":"https://api.github.com/repos/margaretoti/library-network/deployments","created_at":"2017-03-21T15:39:21Z","updated_at":"2017-04-14T18:21:26Z","pushed_at":"2017-04-17T22:05:56Z","git_url":"git://github.com/margaretoti/library-network.git","ssh_url":"git@github.com:margaretoti/library-network.git","clone_url":"https://github.com/margaretoti/library-network.git","svn_url":"https://github.com/margaretoti/library-network","homepage":"","size":107,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/11"},"html":{"href":"https://github.com/margaretoti/library-network/pull/11"},"issue":{"href":"https://api.github.com/repos/margaretoti/library-network/issues/11"},"comments":{"href":"https://api.github.com/repos/margaretoti/library-network/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/margaretoti/library-network/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/margaretoti/library-network/statuses/07c1e8d2826d77934a8d6a3f57b875e94ee62db7"}}}}
{"actor":{"display_login":"margaretoti"}}