{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/cwsb_01/pulls/comments/87536172","pull_request_review_id":8145664,"id":87536172,"diff_hunk":"@@ -38,4 +44,15 @@ class Booking < ApplicationRecord\n         (bookings.state = ? OR state = ?) AND orders.status = ?\",\n         date, Settings.requested, Settings.state_pending, Settings.status_pending\n   end\n+\n+  def total_price\n+    select_price(space, booking_type_id) * quantity\n+  end\n+\n+  def order_referenced_with_booking?\n+    @order = Order.find_by id: order_id\n+    if @order\n+      @order.update_attributes deleted_at: Time.now() unless @order.bookings.any?","path":"app/models/booking.rb","position":41,"original_position":41,"commit_id":"05afe6030cd3b1bee0f792e794a59837fee54765","original_commit_id":"05afe6030cd3b1bee0f792e794a59837fee54765","user":{"login":"nvtanh","id":5591946,"avatar_url":"https://avatars.githubusercontent.com/u/5591946?v=3","gravatar_id":"","url":"https://api.github.com/users/nvtanh","html_url":"https://github.com/nvtanh","followers_url":"https://api.github.com/users/nvtanh/followers","following_url":"https://api.github.com/users/nvtanh/following{/other_user}","gists_url":"https://api.github.com/users/nvtanh/gists{/gist_id}","starred_url":"https://api.github.com/users/nvtanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvtanh/subscriptions","organizations_url":"https://api.github.com/users/nvtanh/orgs","repos_url":"https://api.github.com/users/nvtanh/repos","events_url":"https://api.github.com/users/nvtanh/events{/privacy}","received_events_url":"https://api.github.com/users/nvtanh/received_events","type":"User","site_admin":false},"body":"dùng Time.current đi e, Time.now là lấy h của local rồi\r\nvới lại cho cái `@order.bookings.any?` nó lên cùng với if ở trên luôn","created_at":"2016-11-11T04:36:09Z","updated_at":"2016-11-11T04:36:47Z","html_url":"https://github.com/framgia/cwsb_01/pull/43#discussion_r87536172","pull_request_url":"https://api.github.com/repos/framgia/cwsb_01/pulls/43","_links":{"self":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/comments/87536172"},"html":{"href":"https://github.com/framgia/cwsb_01/pull/43#discussion_r87536172"},"pull_request":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/cwsb_01/pulls/43","id":92747902,"html_url":"https://github.com/framgia/cwsb_01/pull/43","diff_url":"https://github.com/framgia/cwsb_01/pull/43.diff","patch_url":"https://github.com/framgia/cwsb_01/pull/43.patch","issue_url":"https://api.github.com/repos/framgia/cwsb_01/issues/43","number":43,"state":"open","locked":false,"title":"payment_by_paypall","user":{"login":"NguyenHoangAnhDung","id":21093421,"avatar_url":"https://avatars.githubusercontent.com/u/21093421?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenHoangAnhDung","html_url":"https://github.com/NguyenHoangAnhDung","followers_url":"https://api.github.com/users/NguyenHoangAnhDung/followers","following_url":"https://api.github.com/users/NguyenHoangAnhDung/following{/other_user}","gists_url":"https://api.github.com/users/NguyenHoangAnhDung/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenHoangAnhDung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenHoangAnhDung/subscriptions","organizations_url":"https://api.github.com/users/NguyenHoangAnhDung/orgs","repos_url":"https://api.github.com/users/NguyenHoangAnhDung/repos","events_url":"https://api.github.com/users/NguyenHoangAnhDung/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenHoangAnhDung/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-08T10:07:09Z","updated_at":"2016-11-11T04:36:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f16ce7dbd6ef71ed139f30eb0ad53001789fe7d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/cwsb_01/pulls/43/commits","review_comments_url":"https://api.github.com/repos/framgia/cwsb_01/pulls/43/comments","review_comment_url":"https://api.github.com/repos/framgia/cwsb_01/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/cwsb_01/issues/43/comments","statuses_url":"https://api.github.com/repos/framgia/cwsb_01/statuses/05afe6030cd3b1bee0f792e794a59837fee54765","head":{"label":"NguyenHoangAnhDung:payment_by_paypall","ref":"payment_by_paypall","sha":"05afe6030cd3b1bee0f792e794a59837fee54765","user":{"login":"NguyenHoangAnhDung","id":21093421,"avatar_url":"https://avatars.githubusercontent.com/u/21093421?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenHoangAnhDung","html_url":"https://github.com/NguyenHoangAnhDung","followers_url":"https://api.github.com/users/NguyenHoangAnhDung/followers","following_url":"https://api.github.com/users/NguyenHoangAnhDung/following{/other_user}","gists_url":"https://api.github.com/users/NguyenHoangAnhDung/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenHoangAnhDung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenHoangAnhDung/subscriptions","organizations_url":"https://api.github.com/users/NguyenHoangAnhDung/orgs","repos_url":"https://api.github.com/users/NguyenHoangAnhDung/repos","events_url":"https://api.github.com/users/NguyenHoangAnhDung/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenHoangAnhDung/received_events","type":"User","site_admin":false},"repo":{"id":69952040,"name":"cwsb_01","full_name":"NguyenHoangAnhDung/cwsb_01","owner":{"login":"NguyenHoangAnhDung","id":21093421,"avatar_url":"https://avatars.githubusercontent.com/u/21093421?v=3","gravatar_id":"","url":"https://api.github.com/users/NguyenHoangAnhDung","html_url":"https://github.com/NguyenHoangAnhDung","followers_url":"https://api.github.com/users/NguyenHoangAnhDung/followers","following_url":"https://api.github.com/users/NguyenHoangAnhDung/following{/other_user}","gists_url":"https://api.github.com/users/NguyenHoangAnhDung/gists{/gist_id}","starred_url":"https://api.github.com/users/NguyenHoangAnhDung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NguyenHoangAnhDung/subscriptions","organizations_url":"https://api.github.com/users/NguyenHoangAnhDung/orgs","repos_url":"https://api.github.com/users/NguyenHoangAnhDung/repos","events_url":"https://api.github.com/users/NguyenHoangAnhDung/events{/privacy}","received_events_url":"https://api.github.com/users/NguyenHoangAnhDung/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NguyenHoangAnhDung/cwsb_01","description":"Co-working space booking system - Danang Education's project","fork":true,"url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01","forks_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/forks","keys_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/teams","hooks_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/hooks","issue_events_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/issues/events{/number}","events_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/events","assignees_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/assignees{/user}","branches_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/branches{/branch}","tags_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/tags","blobs_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/statuses/{sha}","languages_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/languages","stargazers_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/stargazers","contributors_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/contributors","subscribers_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/subscribers","subscription_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/subscription","commits_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/contents/{+path}","compare_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/merges","archive_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/downloads","issues_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/issues{/number}","pulls_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/pulls{/number}","milestones_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/milestones{/number}","notifications_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/labels{/name}","releases_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/releases{/id}","deployments_url":"https://api.github.com/repos/NguyenHoangAnhDung/cwsb_01/deployments","created_at":"2016-10-04T09:44:55Z","updated_at":"2016-10-04T03:49:56Z","pushed_at":"2016-11-11T04:17:56Z","git_url":"git://github.com/NguyenHoangAnhDung/cwsb_01.git","ssh_url":"git@github.com:NguyenHoangAnhDung/cwsb_01.git","clone_url":"https://github.com/NguyenHoangAnhDung/cwsb_01.git","svn_url":"https://github.com/NguyenHoangAnhDung/cwsb_01","homepage":null,"size":4865,"stargazers_count":0,"watchers_count":0,"language":null,"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":"framgia:develop","ref":"develop","sha":"da2fbc3e57a71960aa14debfe3fa2ef5acf253bd","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.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":69932509,"name":"cwsb_01","full_name":"framgia/cwsb_01","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.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/cwsb_01","description":"Co-working space booking system - Danang Education's project","fork":false,"url":"https://api.github.com/repos/framgia/cwsb_01","forks_url":"https://api.github.com/repos/framgia/cwsb_01/forks","keys_url":"https://api.github.com/repos/framgia/cwsb_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/cwsb_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/cwsb_01/teams","hooks_url":"https://api.github.com/repos/framgia/cwsb_01/hooks","issue_events_url":"https://api.github.com/repos/framgia/cwsb_01/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/cwsb_01/events","assignees_url":"https://api.github.com/repos/framgia/cwsb_01/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/cwsb_01/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/cwsb_01/tags","blobs_url":"https://api.github.com/repos/framgia/cwsb_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/cwsb_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/cwsb_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/cwsb_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/cwsb_01/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/cwsb_01/languages","stargazers_url":"https://api.github.com/repos/framgia/cwsb_01/stargazers","contributors_url":"https://api.github.com/repos/framgia/cwsb_01/contributors","subscribers_url":"https://api.github.com/repos/framgia/cwsb_01/subscribers","subscription_url":"https://api.github.com/repos/framgia/cwsb_01/subscription","commits_url":"https://api.github.com/repos/framgia/cwsb_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/cwsb_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/cwsb_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/cwsb_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/cwsb_01/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/cwsb_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/cwsb_01/merges","archive_url":"https://api.github.com/repos/framgia/cwsb_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/cwsb_01/downloads","issues_url":"https://api.github.com/repos/framgia/cwsb_01/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/cwsb_01/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/cwsb_01/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/cwsb_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/cwsb_01/labels{/name}","releases_url":"https://api.github.com/repos/framgia/cwsb_01/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/cwsb_01/deployments","created_at":"2016-10-04T03:49:56Z","updated_at":"2016-10-04T03:49:56Z","pushed_at":"2016-11-11T04:17:56Z","git_url":"git://github.com/framgia/cwsb_01.git","ssh_url":"git@github.com:framgia/cwsb_01.git","clone_url":"https://github.com/framgia/cwsb_01.git","svn_url":"https://github.com/framgia/cwsb_01","homepage":null,"size":4956,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":9,"forks":8,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/43"},"html":{"href":"https://github.com/framgia/cwsb_01/pull/43"},"issue":{"href":"https://api.github.com/repos/framgia/cwsb_01/issues/43"},"comments":{"href":"https://api.github.com/repos/framgia/cwsb_01/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/cwsb_01/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/cwsb_01/statuses/05afe6030cd3b1bee0f792e794a59837fee54765"}}}}
{"actor":{"display_login":"nvtanh"}}