{"action":"created","issue":{"url":"https://api.github.com/repos/makandra/assignable_values/issues/9","labels_url":"https://api.github.com/repos/makandra/assignable_values/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/makandra/assignable_values/issues/9/comments","events_url":"https://api.github.com/repos/makandra/assignable_values/issues/9/events","html_url":"https://github.com/makandra/assignable_values/issues/9","id":77652609,"number":9,"title":"Restrict values that can *not* be assigned","user":{"login":"elsapet","id":4560746,"avatar_url":"https://avatars.githubusercontent.com/u/4560746?v=3","gravatar_id":"","url":"https://api.github.com/users/elsapet","html_url":"https://github.com/elsapet","followers_url":"https://api.github.com/users/elsapet/followers","following_url":"https://api.github.com/users/elsapet/following{/other_user}","gists_url":"https://api.github.com/users/elsapet/gists{/gist_id}","starred_url":"https://api.github.com/users/elsapet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsapet/subscriptions","organizations_url":"https://api.github.com/users/elsapet/orgs","repos_url":"https://api.github.com/users/elsapet/repos","events_url":"https://api.github.com/users/elsapet/events{/privacy}","received_events_url":"https://api.github.com/users/elsapet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-18T13:15:31Z","updated_at":"2015-05-28T08:46:09Z","closed_at":"2015-05-28T08:46:09Z","body":"Is there a way to restrict the values that can *not* be assigned to attributes or associations? \r\nFor example, if I wanted `user.name` to be any value except `admin` or `administrator`, I could do something like this:\r\n```\r\nclass User < ActiveRecord::Base\r\n  non_assignable_values_for :name do\r\n    ['admin', 'administrator']\r\n  end\r\nend\r\n```\r\nAnd if there isn't a way, would this be worth a pull request?\r\nThanks for a great gem, by the way :)"},"comment":{"url":"https://api.github.com/repos/makandra/assignable_values/issues/comments/106234807","html_url":"https://github.com/makandra/assignable_values/issues/9#issuecomment-106234807","issue_url":"https://api.github.com/repos/makandra/assignable_values/issues/9","id":106234807,"user":{"login":"elsapet","id":4560746,"avatar_url":"https://avatars.githubusercontent.com/u/4560746?v=3","gravatar_id":"","url":"https://api.github.com/users/elsapet","html_url":"https://github.com/elsapet","followers_url":"https://api.github.com/users/elsapet/followers","following_url":"https://api.github.com/users/elsapet/following{/other_user}","gists_url":"https://api.github.com/users/elsapet/gists{/gist_id}","starred_url":"https://api.github.com/users/elsapet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elsapet/subscriptions","organizations_url":"https://api.github.com/users/elsapet/orgs","repos_url":"https://api.github.com/users/elsapet/repos","events_url":"https://api.github.com/users/elsapet/events{/privacy}","received_events_url":"https://api.github.com/users/elsapet/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T08:46:09Z","updated_at":"2015-05-28T08:46:09Z","body":"Thank you @codener and @henning-koch for the responses. I hadn't thought of those cases! \r\nThanks for the ```validates_exclusion_of``` suggestion -- it will work great for my situation."}}