{"action":"created","issue":{"url":"https://api.github.com/repos/RubyMoney/money-rails/issues/305","labels_url":"https://api.github.com/repos/RubyMoney/money-rails/issues/305/labels{/name}","comments_url":"https://api.github.com/repos/RubyMoney/money-rails/issues/305/comments","events_url":"https://api.github.com/repos/RubyMoney/money-rails/issues/305/events","html_url":"https://github.com/RubyMoney/money-rails/issues/305","id":64616266,"number":305,"title":"Validate numericaly","user":{"login":"oprema","id":4787962,"avatar_url":"https://avatars.githubusercontent.com/u/4787962?v=3","gravatar_id":"","url":"https://api.github.com/users/oprema","html_url":"https://github.com/oprema","followers_url":"https://api.github.com/users/oprema/followers","following_url":"https://api.github.com/users/oprema/following{/other_user}","gists_url":"https://api.github.com/users/oprema/gists{/gist_id}","starred_url":"https://api.github.com/users/oprema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oprema/subscriptions","organizations_url":"https://api.github.com/users/oprema/orgs","repos_url":"https://api.github.com/users/oprema/repos","events_url":"https://api.github.com/users/oprema/events{/privacy}","received_events_url":"https://api.github.com/users/oprema/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-26T19:38:48Z","updated_at":"2015-03-27T12:44:58Z","closed_at":"2015-03-27T12:44:58Z","body":"Hi,\r\n\r\nin a model I have a validation like that:\r\n```\r\nmonetize :monthly_cents, numericality: { greater_than_or_equal_to: 1, less_than_or_equal_to: 5 }\r\n```\r\nTo test it I use a rails console\r\nFirst I instantiate an object p and do\r\n```\r\np.monthly_cents = 3\r\np.valid? => true\r\np.monthly_cents = 6\r\np.valid? => false\r\n```\r\nas it should be\r\nIf I do the same with\r\n```\r\np.monthly = Money.new(3, 'EUR')\r\np.valid? => false\r\n```\r\nAm I doing something stupid or is this a validation bug?\r\nI am on Rails 4.2 with postgresql and have read the notice"},"comment":{"url":"https://api.github.com/repos/RubyMoney/money-rails/issues/comments/86930089","html_url":"https://github.com/RubyMoney/money-rails/issues/305#issuecomment-86930089","issue_url":"https://api.github.com/repos/RubyMoney/money-rails/issues/305","id":86930089,"user":{"login":"oprema","id":4787962,"avatar_url":"https://avatars.githubusercontent.com/u/4787962?v=3","gravatar_id":"","url":"https://api.github.com/users/oprema","html_url":"https://github.com/oprema","followers_url":"https://api.github.com/users/oprema/followers","following_url":"https://api.github.com/users/oprema/following{/other_user}","gists_url":"https://api.github.com/users/oprema/gists{/gist_id}","starred_url":"https://api.github.com/users/oprema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oprema/subscriptions","organizations_url":"https://api.github.com/users/oprema/orgs","repos_url":"https://api.github.com/users/oprema/repos","events_url":"https://api.github.com/users/oprema/events{/privacy}","received_events_url":"https://api.github.com/users/oprema/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T12:44:58Z","updated_at":"2015-03-27T12:44:58Z","body":"Big thanks to @antstorm and all the others who answered. Yep, I agree, this was not clear to me but subunit_numericality  did the trick."}}