{"action":"created","comment":{"url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/comments/227518928","pull_request_review_id":167579759,"id":227518928,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzUxODkyOA==","diff_hunk":"@@ -0,0 +1,12 @@\n+class CreateProducts < ActiveRecord::Migration[5.2]\n+  def change\n+    create_table :products do |t|\n+      t.string :title\n+      t.text :content\n+      t.integer :price","path":"db/migrate/20181022173408_create_products.rb","position":6,"original_position":6,"commit_id":"f97445b0906cc4386bde28f7d191674b3d564342","original_commit_id":"f97445b0906cc4386bde28f7d191674b3d564342","user":{"login":"piotrimbierowicz","id":1816352,"node_id":"MDQ6VXNlcjE4MTYzNTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1816352?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrimbierowicz","html_url":"https://github.com/piotrimbierowicz","followers_url":"https://api.github.com/users/piotrimbierowicz/followers","following_url":"https://api.github.com/users/piotrimbierowicz/following{/other_user}","gists_url":"https://api.github.com/users/piotrimbierowicz/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrimbierowicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrimbierowicz/subscriptions","organizations_url":"https://api.github.com/users/piotrimbierowicz/orgs","repos_url":"https://api.github.com/users/piotrimbierowicz/repos","events_url":"https://api.github.com/users/piotrimbierowicz/events{/privacy}","received_events_url":"https://api.github.com/users/piotrimbierowicz/received_events","type":"User","site_admin":false},"body":"Tutaj przychodzimy do częstego zagadnienia - w jakim typie danych przechowywać kwoty. Ja zazwyczaj korzystałem z https://github.com/RubyMoney/money \r\n\r\nJeśli price jest typu integer (i takiego typu powinien być) przedstawia on kwotę w centach/w groszach. \r\n$2,5 to `price: 250` \r\nWtedy stosuje się nazewnictwo które na to wskazuje, np. `price_cents` zamiast `price`. \r\nNiestety zmusza to konwersji na potrzeby widoku w widoku, np. tworzenia osobnej metody \r\n```\r\ndef price_dollars\r\n  price_cents.to_f / 100\r\nend\r\n```","created_at":"2018-10-23T18:46:41Z","updated_at":"2018-10-23T18:46:42Z","html_url":"https://github.com/MoloToha/ror-2018-project/pull/2#discussion_r227518928","pull_request_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/comments/227518928"},"html":{"href":"https://github.com/MoloToha/ror-2018-project/pull/2#discussion_r227518928"},"pull_request":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2","id":225079150,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDc5MTUw","html_url":"https://github.com/MoloToha/ror-2018-project/pull/2","diff_url":"https://github.com/MoloToha/ror-2018-project/pull/2.diff","patch_url":"https://github.com/MoloToha/ror-2018-project/pull/2.patch","issue_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/2","number":2,"state":"open","locked":false,"title":"Release/0.1.0","user":{"login":"MoloToha","id":5648479,"node_id":"MDQ6VXNlcjU2NDg0Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5648479?v=4","gravatar_id":"","url":"https://api.github.com/users/MoloToha","html_url":"https://github.com/MoloToha","followers_url":"https://api.github.com/users/MoloToha/followers","following_url":"https://api.github.com/users/MoloToha/following{/other_user}","gists_url":"https://api.github.com/users/MoloToha/gists{/gist_id}","starred_url":"https://api.github.com/users/MoloToha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoloToha/subscriptions","organizations_url":"https://api.github.com/users/MoloToha/orgs","repos_url":"https://api.github.com/users/MoloToha/repos","events_url":"https://api.github.com/users/MoloToha/events{/privacy}","received_events_url":"https://api.github.com/users/MoloToha/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-23T15:11:11Z","updated_at":"2018-10-23T18:46:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f57e6d84d8b76f65d7adff9c143f68f76b21f65","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2/commits","review_comments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2/comments","review_comment_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/2/comments","statuses_url":"https://api.github.com/repos/MoloToha/ror-2018-project/statuses/f97445b0906cc4386bde28f7d191674b3d564342","head":{"label":"MoloToha:release/0.1.0","ref":"release/0.1.0","sha":"f97445b0906cc4386bde28f7d191674b3d564342","user":{"login":"MoloToha","id":5648479,"node_id":"MDQ6VXNlcjU2NDg0Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5648479?v=4","gravatar_id":"","url":"https://api.github.com/users/MoloToha","html_url":"https://github.com/MoloToha","followers_url":"https://api.github.com/users/MoloToha/followers","following_url":"https://api.github.com/users/MoloToha/following{/other_user}","gists_url":"https://api.github.com/users/MoloToha/gists{/gist_id}","starred_url":"https://api.github.com/users/MoloToha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoloToha/subscriptions","organizations_url":"https://api.github.com/users/MoloToha/orgs","repos_url":"https://api.github.com/users/MoloToha/repos","events_url":"https://api.github.com/users/MoloToha/events{/privacy}","received_events_url":"https://api.github.com/users/MoloToha/received_events","type":"User","site_admin":false},"repo":{"id":153173435,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxNzM0MzU=","name":"ror-2018-project","full_name":"MoloToha/ror-2018-project","private":false,"owner":{"login":"MoloToha","id":5648479,"node_id":"MDQ6VXNlcjU2NDg0Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5648479?v=4","gravatar_id":"","url":"https://api.github.com/users/MoloToha","html_url":"https://github.com/MoloToha","followers_url":"https://api.github.com/users/MoloToha/followers","following_url":"https://api.github.com/users/MoloToha/following{/other_user}","gists_url":"https://api.github.com/users/MoloToha/gists{/gist_id}","starred_url":"https://api.github.com/users/MoloToha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoloToha/subscriptions","organizations_url":"https://api.github.com/users/MoloToha/orgs","repos_url":"https://api.github.com/users/MoloToha/repos","events_url":"https://api.github.com/users/MoloToha/events{/privacy}","received_events_url":"https://api.github.com/users/MoloToha/received_events","type":"User","site_admin":false},"html_url":"https://github.com/MoloToha/ror-2018-project","description":null,"fork":false,"url":"https://api.github.com/repos/MoloToha/ror-2018-project","forks_url":"https://api.github.com/repos/MoloToha/ror-2018-project/forks","keys_url":"https://api.github.com/repos/MoloToha/ror-2018-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MoloToha/ror-2018-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MoloToha/ror-2018-project/teams","hooks_url":"https://api.github.com/repos/MoloToha/ror-2018-project/hooks","issue_events_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/events{/number}","events_url":"https://api.github.com/repos/MoloToha/ror-2018-project/events","assignees_url":"https://api.github.com/repos/MoloToha/ror-2018-project/assignees{/user}","branches_url":"https://api.github.com/repos/MoloToha/ror-2018-project/branches{/branch}","tags_url":"https://api.github.com/repos/MoloToha/ror-2018-project/tags","blobs_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MoloToha/ror-2018-project/statuses/{sha}","languages_url":"https://api.github.com/repos/MoloToha/ror-2018-project/languages","stargazers_url":"https://api.github.com/repos/MoloToha/ror-2018-project/stargazers","contributors_url":"https://api.github.com/repos/MoloToha/ror-2018-project/contributors","subscribers_url":"https://api.github.com/repos/MoloToha/ror-2018-project/subscribers","subscription_url":"https://api.github.com/repos/MoloToha/ror-2018-project/subscription","commits_url":"https://api.github.com/repos/MoloToha/ror-2018-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/MoloToha/ror-2018-project/contents/{+path}","compare_url":"https://api.github.com/repos/MoloToha/ror-2018-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MoloToha/ror-2018-project/merges","archive_url":"https://api.github.com/repos/MoloToha/ror-2018-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MoloToha/ror-2018-project/downloads","issues_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues{/number}","pulls_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls{/number}","milestones_url":"https://api.github.com/repos/MoloToha/ror-2018-project/milestones{/number}","notifications_url":"https://api.github.com/repos/MoloToha/ror-2018-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MoloToha/ror-2018-project/labels{/name}","releases_url":"https://api.github.com/repos/MoloToha/ror-2018-project/releases{/id}","deployments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/deployments","created_at":"2018-10-15T19:57:27Z","updated_at":"2018-10-21T17:57:53Z","pushed_at":"2018-10-23T15:21:52Z","git_url":"git://github.com/MoloToha/ror-2018-project.git","ssh_url":"git@github.com:MoloToha/ror-2018-project.git","clone_url":"https://github.com/MoloToha/ror-2018-project.git","svn_url":"https://github.com/MoloToha/ror-2018-project","homepage":null,"size":43,"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,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"MoloToha:master","ref":"master","sha":"425b5db9f529afb956e17e55c360d26f5ceab764","user":{"login":"MoloToha","id":5648479,"node_id":"MDQ6VXNlcjU2NDg0Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5648479?v=4","gravatar_id":"","url":"https://api.github.com/users/MoloToha","html_url":"https://github.com/MoloToha","followers_url":"https://api.github.com/users/MoloToha/followers","following_url":"https://api.github.com/users/MoloToha/following{/other_user}","gists_url":"https://api.github.com/users/MoloToha/gists{/gist_id}","starred_url":"https://api.github.com/users/MoloToha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoloToha/subscriptions","organizations_url":"https://api.github.com/users/MoloToha/orgs","repos_url":"https://api.github.com/users/MoloToha/repos","events_url":"https://api.github.com/users/MoloToha/events{/privacy}","received_events_url":"https://api.github.com/users/MoloToha/received_events","type":"User","site_admin":false},"repo":{"id":153173435,"node_id":"MDEwOlJlcG9zaXRvcnkxNTMxNzM0MzU=","name":"ror-2018-project","full_name":"MoloToha/ror-2018-project","private":false,"owner":{"login":"MoloToha","id":5648479,"node_id":"MDQ6VXNlcjU2NDg0Nzk=","avatar_url":"https://avatars1.githubusercontent.com/u/5648479?v=4","gravatar_id":"","url":"https://api.github.com/users/MoloToha","html_url":"https://github.com/MoloToha","followers_url":"https://api.github.com/users/MoloToha/followers","following_url":"https://api.github.com/users/MoloToha/following{/other_user}","gists_url":"https://api.github.com/users/MoloToha/gists{/gist_id}","starred_url":"https://api.github.com/users/MoloToha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoloToha/subscriptions","organizations_url":"https://api.github.com/users/MoloToha/orgs","repos_url":"https://api.github.com/users/MoloToha/repos","events_url":"https://api.github.com/users/MoloToha/events{/privacy}","received_events_url":"https://api.github.com/users/MoloToha/received_events","type":"User","site_admin":false},"html_url":"https://github.com/MoloToha/ror-2018-project","description":null,"fork":false,"url":"https://api.github.com/repos/MoloToha/ror-2018-project","forks_url":"https://api.github.com/repos/MoloToha/ror-2018-project/forks","keys_url":"https://api.github.com/repos/MoloToha/ror-2018-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MoloToha/ror-2018-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MoloToha/ror-2018-project/teams","hooks_url":"https://api.github.com/repos/MoloToha/ror-2018-project/hooks","issue_events_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/events{/number}","events_url":"https://api.github.com/repos/MoloToha/ror-2018-project/events","assignees_url":"https://api.github.com/repos/MoloToha/ror-2018-project/assignees{/user}","branches_url":"https://api.github.com/repos/MoloToha/ror-2018-project/branches{/branch}","tags_url":"https://api.github.com/repos/MoloToha/ror-2018-project/tags","blobs_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MoloToha/ror-2018-project/statuses/{sha}","languages_url":"https://api.github.com/repos/MoloToha/ror-2018-project/languages","stargazers_url":"https://api.github.com/repos/MoloToha/ror-2018-project/stargazers","contributors_url":"https://api.github.com/repos/MoloToha/ror-2018-project/contributors","subscribers_url":"https://api.github.com/repos/MoloToha/ror-2018-project/subscribers","subscription_url":"https://api.github.com/repos/MoloToha/ror-2018-project/subscription","commits_url":"https://api.github.com/repos/MoloToha/ror-2018-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/MoloToha/ror-2018-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/MoloToha/ror-2018-project/contents/{+path}","compare_url":"https://api.github.com/repos/MoloToha/ror-2018-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MoloToha/ror-2018-project/merges","archive_url":"https://api.github.com/repos/MoloToha/ror-2018-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MoloToha/ror-2018-project/downloads","issues_url":"https://api.github.com/repos/MoloToha/ror-2018-project/issues{/number}","pulls_url":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls{/number}","milestones_url":"https://api.github.com/repos/MoloToha/ror-2018-project/milestones{/number}","notifications_url":"https://api.github.com/repos/MoloToha/ror-2018-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MoloToha/ror-2018-project/labels{/name}","releases_url":"https://api.github.com/repos/MoloToha/ror-2018-project/releases{/id}","deployments_url":"https://api.github.com/repos/MoloToha/ror-2018-project/deployments","created_at":"2018-10-15T19:57:27Z","updated_at":"2018-10-21T17:57:53Z","pushed_at":"2018-10-23T15:21:52Z","git_url":"git://github.com/MoloToha/ror-2018-project.git","ssh_url":"git@github.com:MoloToha/ror-2018-project.git","clone_url":"https://github.com/MoloToha/ror-2018-project.git","svn_url":"https://github.com/MoloToha/ror-2018-project","homepage":null,"size":43,"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,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2"},"html":{"href":"https://github.com/MoloToha/ror-2018-project/pull/2"},"issue":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/2"},"comments":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/MoloToha/ror-2018-project/statuses/f97445b0906cc4386bde28f7d191674b3d564342"}},"author_association":"OWNER"}}
{"actor":{"display_login":"piotrimbierowicz"}}