{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/42527077","id":42527077,"diff_hunk":"@@ -0,0 +1,5 @@\n+class AddMeasureRefToChargebackRateDetail < ActiveRecord::Migration\n+  def change\n+    add_reference :chargeback_rate_details, :chargeback_rate_detail_measure, :foreign_key => true","path":"db/migrate/20151008114125_add_measure_ref_to_chargeback_rate_detail.rb","position":3,"original_position":3,"commit_id":"41810475783fc9c79329e3f0879fee4f69255d11","original_commit_id":"41810475783fc9c79329e3f0879fee4f69255d11","user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"body":"I believe this needs to specify the type as `:bigint`","created_at":"2015-10-20T17:33:47Z","updated_at":"2015-10-20T17:33:47Z","html_url":"https://github.com/ManageIQ/manageiq/pull/4887#discussion_r42527077","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/42527077"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/4887#discussion_r42527077"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887","id":47778112,"html_url":"https://github.com/ManageIQ/manageiq/pull/4887","diff_url":"https://github.com/ManageIQ/manageiq/pull/4887.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/4887.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4887","number":4887,"state":"open","locked":false,"title":"Measurements types rebuilded","user":{"login":"amaurygonzalez","id":14124243,"avatar_url":"https://avatars.githubusercontent.com/u/14124243?v=3","gravatar_id":"","url":"https://api.github.com/users/amaurygonzalez","html_url":"https://github.com/amaurygonzalez","followers_url":"https://api.github.com/users/amaurygonzalez/followers","following_url":"https://api.github.com/users/amaurygonzalez/following{/other_user}","gists_url":"https://api.github.com/users/amaurygonzalez/gists{/gist_id}","starred_url":"https://api.github.com/users/amaurygonzalez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaurygonzalez/subscriptions","organizations_url":"https://api.github.com/users/amaurygonzalez/orgs","repos_url":"https://api.github.com/users/amaurygonzalez/repos","events_url":"https://api.github.com/users/amaurygonzalez/events{/privacy}","received_events_url":"https://api.github.com/users/amaurygonzalez/received_events","type":"User","site_admin":false},"body":"# Define measurement types \r\n\r\nAs per user case: IUC10\r\nLink: https://github.com/rhus/charging-docs/wiki/Requirements:-Collection-and-Mediation\r\nTrello card: https://trello.com/c/vxZVQPCe/8-define-measurement-types\r\nDescription: \r\nAs an administrator, I want to be able to define new measurements and their relationship. For instance: I want to be able to measure in MB, and I relate that to KB and B. I can also measure in MiB, KiB.\r\n## Implementation:\r\n\r\nWe have created a model measure (chargeback_rate_detail_measure) that has the attributes: name, units, units_display and step. Units is an arrangement of units of measurement eg. \"B, KB, MB ...\". A step reference to the distance between units, this then facilitates conversion between measurements. The Measures are loaded from a yml file, later when the Develop do a seed, this data are loaded from the yml and saved on the ManageIQ bd. \r\nEvery rate detail (chargeback_rate_detail) has a reference to its measure. As soon as you create or edit a rapid rate it is now possible to define a rate value in response to these new units of measure. The cost is then calculated taking into account the conversion of the units designated by the user ManageIQ units used to measure the use and utilization.\r\n## To be done:\r\nAn administrator can edit these units from the Configure/Configuration/Region/Chargeback online editing in this section the yml file.","created_at":"2015-10-15T12:14:43Z","updated_at":"2015-10-20T17:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94065d7b8cd6ae29552ac4cbfa81f2e2bb5b95b8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/4887/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/41810475783fc9c79329e3f0879fee4f69255d11","head":{"label":"rhus:measurements-types-rebuilded","ref":"measurements-types-rebuilded","sha":"41810475783fc9c79329e3f0879fee4f69255d11","user":{"login":"rhus","id":14151044,"avatar_url":"https://avatars.githubusercontent.com/u/14151044?v=3","gravatar_id":"","url":"https://api.github.com/users/rhus","html_url":"https://github.com/rhus","followers_url":"https://api.github.com/users/rhus/followers","following_url":"https://api.github.com/users/rhus/following{/other_user}","gists_url":"https://api.github.com/users/rhus/gists{/gist_id}","starred_url":"https://api.github.com/users/rhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhus/subscriptions","organizations_url":"https://api.github.com/users/rhus/orgs","repos_url":"https://api.github.com/users/rhus/repos","events_url":"https://api.github.com/users/rhus/events{/privacy}","received_events_url":"https://api.github.com/users/rhus/received_events","type":"Organization","site_admin":false},"repo":{"id":42049284,"name":"manageiq","full_name":"rhus/manageiq","owner":{"login":"rhus","id":14151044,"avatar_url":"https://avatars.githubusercontent.com/u/14151044?v=3","gravatar_id":"","url":"https://api.github.com/users/rhus","html_url":"https://github.com/rhus","followers_url":"https://api.github.com/users/rhus/followers","following_url":"https://api.github.com/users/rhus/following{/other_user}","gists_url":"https://api.github.com/users/rhus/gists{/gist_id}","starred_url":"https://api.github.com/users/rhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhus/subscriptions","organizations_url":"https://api.github.com/users/rhus/orgs","repos_url":"https://api.github.com/users/rhus/repos","events_url":"https://api.github.com/users/rhus/events{/privacy}","received_events_url":"https://api.github.com/users/rhus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rhus/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/rhus/manageiq","forks_url":"https://api.github.com/repos/rhus/manageiq/forks","keys_url":"https://api.github.com/repos/rhus/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhus/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhus/manageiq/teams","hooks_url":"https://api.github.com/repos/rhus/manageiq/hooks","issue_events_url":"https://api.github.com/repos/rhus/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/rhus/manageiq/events","assignees_url":"https://api.github.com/repos/rhus/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/rhus/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/rhus/manageiq/tags","blobs_url":"https://api.github.com/repos/rhus/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhus/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhus/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhus/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhus/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/rhus/manageiq/languages","stargazers_url":"https://api.github.com/repos/rhus/manageiq/stargazers","contributors_url":"https://api.github.com/repos/rhus/manageiq/contributors","subscribers_url":"https://api.github.com/repos/rhus/manageiq/subscribers","subscription_url":"https://api.github.com/repos/rhus/manageiq/subscription","commits_url":"https://api.github.com/repos/rhus/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhus/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhus/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhus/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhus/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/rhus/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhus/manageiq/merges","archive_url":"https://api.github.com/repos/rhus/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhus/manageiq/downloads","issues_url":"https://api.github.com/repos/rhus/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/rhus/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/rhus/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/rhus/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhus/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/rhus/manageiq/releases{/id}","created_at":"2015-09-07T11:29:14Z","updated_at":"2015-09-07T11:29:31Z","pushed_at":"2015-10-20T17:22:44Z","git_url":"git://github.com/rhus/manageiq.git","ssh_url":"git@github.com:rhus/manageiq.git","clone_url":"https://github.com/rhus/manageiq.git","svn_url":"https://github.com/rhus/manageiq","homepage":"manageiq.org","size":90489,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"8496a11110b2976a5ec37275a7cfec6b319dd7de","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","created_at":"2014-06-13T02:31:26Z","updated_at":"2015-10-13T21:08:35Z","pushed_at":"2015-10-20T17:23:38Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":177206,"stargazers_count":161,"watchers_count":161,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":171,"mirror_url":null,"open_issues_count":450,"forks":171,"open_issues":450,"watchers":161,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/4887"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/4887"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/4887/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/4887/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/41810475783fc9c79329e3f0879fee4f69255d11"}}}}