{"action":"opened","number":15,"pull_request":{"url":"https://api.github.com/repos/Shopify/measured-rails/pulls/15","id":41190808,"html_url":"https://github.com/Shopify/measured-rails/pull/15","diff_url":"https://github.com/Shopify/measured-rails/pull/15.diff","patch_url":"https://github.com/Shopify/measured-rails/pull/15.patch","issue_url":"https://api.github.com/repos/Shopify/measured-rails/issues/15","number":15,"state":"open","locked":false,"title":"Allow numeric comparison against scalar.","user":{"login":"garethson","id":249488,"avatar_url":"https://avatars.githubusercontent.com/u/249488?v=3","gravatar_id":"","url":"https://api.github.com/users/garethson","html_url":"https://github.com/garethson","followers_url":"https://api.github.com/users/garethson/followers","following_url":"https://api.github.com/users/garethson/following{/other_user}","gists_url":"https://api.github.com/users/garethson/gists{/gist_id}","starred_url":"https://api.github.com/users/garethson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethson/subscriptions","organizations_url":"https://api.github.com/users/garethson/orgs","repos_url":"https://api.github.com/users/garethson/repos","events_url":"https://api.github.com/users/garethson/events{/privacy}","received_events_url":"https://api.github.com/users/garethson/received_events","type":"User","site_admin":false},"body":"We currently don't support this in Shopify:\r\n```ruby\r\n validates :length, :width, :height, measured: {greater_than: 0, less_than: 999999}\r\n```\r\nwhich causes us to have to change it to\r\n```ruby\r\nvalidates :length_value, :width_value, :height_value, numericality: {greater_than: 0, less_than: 999999, allow_nil: true}\r\n```\r\nwhich is unfortunate, as we loose our nice error messages and also expose the internals of `Measured` to the consuming interface.\r\n\r\nI realize that enforcing a `less_than: X` on a Measurable field can seem strange, but in reality most of our use cases currently need to do this. The limits that software puts on fields is *usually* because of underlying storage constraints, not some real-world limit, like \"over 100 lbs\". This gives us the ability to still do both.\r\n\r\n@cyprusad @kmcphillips @cyprusad ","created_at":"2015-07-30T01:43:13Z","updated_at":"2015-07-30T01:43:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Shopify/measured-rails/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Shopify/measured-rails/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Shopify/measured-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Shopify/measured-rails/issues/15/comments","statuses_url":"https://api.github.com/repos/Shopify/measured-rails/statuses/4c8e35e2bcbcc859f510f7f2fcd2fc92ad766a45","head":{"label":"Shopify:allow-numeric-validation","ref":"allow-numeric-validation","sha":"4c8e35e2bcbcc859f510f7f2fcd2fc92ad766a45","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":31735519,"name":"measured-rails","full_name":"Shopify/measured-rails","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/measured-rails","description":"Rails adapter for the measured gem. Encapsulate measurements and their units in Ruby and Rails.","fork":false,"url":"https://api.github.com/repos/Shopify/measured-rails","forks_url":"https://api.github.com/repos/Shopify/measured-rails/forks","keys_url":"https://api.github.com/repos/Shopify/measured-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/measured-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/measured-rails/teams","hooks_url":"https://api.github.com/repos/Shopify/measured-rails/hooks","issue_events_url":"https://api.github.com/repos/Shopify/measured-rails/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/measured-rails/events","assignees_url":"https://api.github.com/repos/Shopify/measured-rails/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/measured-rails/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/measured-rails/tags","blobs_url":"https://api.github.com/repos/Shopify/measured-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/measured-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/measured-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/measured-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/measured-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/measured-rails/languages","stargazers_url":"https://api.github.com/repos/Shopify/measured-rails/stargazers","contributors_url":"https://api.github.com/repos/Shopify/measured-rails/contributors","subscribers_url":"https://api.github.com/repos/Shopify/measured-rails/subscribers","subscription_url":"https://api.github.com/repos/Shopify/measured-rails/subscription","commits_url":"https://api.github.com/repos/Shopify/measured-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/measured-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/measured-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/measured-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/measured-rails/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/measured-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/measured-rails/merges","archive_url":"https://api.github.com/repos/Shopify/measured-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/measured-rails/downloads","issues_url":"https://api.github.com/repos/Shopify/measured-rails/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/measured-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/measured-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/measured-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/measured-rails/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/measured-rails/releases{/id}","created_at":"2015-03-05T20:48:38Z","updated_at":"2015-05-11T13:23:03Z","pushed_at":"2015-07-30T01:38:06Z","git_url":"git://github.com/Shopify/measured-rails.git","ssh_url":"git@github.com:Shopify/measured-rails.git","clone_url":"https://github.com/Shopify/measured-rails.git","svn_url":"https://github.com/Shopify/measured-rails","homepage":"","size":316,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Shopify:master","ref":"master","sha":"016e6cb1778bb91029df9593fe4c6af379b324ef","user":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"repo":{"id":31735519,"name":"measured-rails","full_name":"Shopify/measured-rails","owner":{"login":"Shopify","id":8085,"avatar_url":"https://avatars.githubusercontent.com/u/8085?v=3","gravatar_id":"","url":"https://api.github.com/users/Shopify","html_url":"https://github.com/Shopify","followers_url":"https://api.github.com/users/Shopify/followers","following_url":"https://api.github.com/users/Shopify/following{/other_user}","gists_url":"https://api.github.com/users/Shopify/gists{/gist_id}","starred_url":"https://api.github.com/users/Shopify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shopify/subscriptions","organizations_url":"https://api.github.com/users/Shopify/orgs","repos_url":"https://api.github.com/users/Shopify/repos","events_url":"https://api.github.com/users/Shopify/events{/privacy}","received_events_url":"https://api.github.com/users/Shopify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Shopify/measured-rails","description":"Rails adapter for the measured gem. Encapsulate measurements and their units in Ruby and Rails.","fork":false,"url":"https://api.github.com/repos/Shopify/measured-rails","forks_url":"https://api.github.com/repos/Shopify/measured-rails/forks","keys_url":"https://api.github.com/repos/Shopify/measured-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Shopify/measured-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Shopify/measured-rails/teams","hooks_url":"https://api.github.com/repos/Shopify/measured-rails/hooks","issue_events_url":"https://api.github.com/repos/Shopify/measured-rails/issues/events{/number}","events_url":"https://api.github.com/repos/Shopify/measured-rails/events","assignees_url":"https://api.github.com/repos/Shopify/measured-rails/assignees{/user}","branches_url":"https://api.github.com/repos/Shopify/measured-rails/branches{/branch}","tags_url":"https://api.github.com/repos/Shopify/measured-rails/tags","blobs_url":"https://api.github.com/repos/Shopify/measured-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Shopify/measured-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Shopify/measured-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/Shopify/measured-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Shopify/measured-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/Shopify/measured-rails/languages","stargazers_url":"https://api.github.com/repos/Shopify/measured-rails/stargazers","contributors_url":"https://api.github.com/repos/Shopify/measured-rails/contributors","subscribers_url":"https://api.github.com/repos/Shopify/measured-rails/subscribers","subscription_url":"https://api.github.com/repos/Shopify/measured-rails/subscription","commits_url":"https://api.github.com/repos/Shopify/measured-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/Shopify/measured-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/Shopify/measured-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/Shopify/measured-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/Shopify/measured-rails/contents/{+path}","compare_url":"https://api.github.com/repos/Shopify/measured-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Shopify/measured-rails/merges","archive_url":"https://api.github.com/repos/Shopify/measured-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Shopify/measured-rails/downloads","issues_url":"https://api.github.com/repos/Shopify/measured-rails/issues{/number}","pulls_url":"https://api.github.com/repos/Shopify/measured-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/Shopify/measured-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/Shopify/measured-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Shopify/measured-rails/labels{/name}","releases_url":"https://api.github.com/repos/Shopify/measured-rails/releases{/id}","created_at":"2015-03-05T20:48:38Z","updated_at":"2015-05-11T13:23:03Z","pushed_at":"2015-07-30T01:38:06Z","git_url":"git://github.com/Shopify/measured-rails.git","ssh_url":"git@github.com:Shopify/measured-rails.git","clone_url":"https://github.com/Shopify/measured-rails.git","svn_url":"https://github.com/Shopify/measured-rails","homepage":"","size":316,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Shopify/measured-rails/pulls/15"},"html":{"href":"https://github.com/Shopify/measured-rails/pull/15"},"issue":{"href":"https://api.github.com/repos/Shopify/measured-rails/issues/15"},"comments":{"href":"https://api.github.com/repos/Shopify/measured-rails/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Shopify/measured-rails/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Shopify/measured-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Shopify/measured-rails/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Shopify/measured-rails/statuses/4c8e35e2bcbcc859f510f7f2fcd2fc92ad766a45"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":27,"deletions":12,"changed_files":5}}