{"action":"created","issue":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/1418","repository_url":"https://api.github.com/repos/neo4jrb/neo4j","labels_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/1418/labels{/name}","comments_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/1418/comments","events_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/1418/events","html_url":"https://github.com/neo4jrb/neo4j/issues/1418","id":258832348,"number":1418,"title":"feature: case-insensitive enums","user":{"login":"thefliik","id":12599934,"avatar_url":"https://avatars3.githubusercontent.com/u/12599934?v=4","gravatar_id":"","url":"https://api.github.com/users/thefliik","html_url":"https://github.com/thefliik","followers_url":"https://api.github.com/users/thefliik/followers","following_url":"https://api.github.com/users/thefliik/following{/other_user}","gists_url":"https://api.github.com/users/thefliik/gists{/gist_id}","starred_url":"https://api.github.com/users/thefliik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefliik/subscriptions","organizations_url":"https://api.github.com/users/thefliik/orgs","repos_url":"https://api.github.com/users/thefliik/repos","events_url":"https://api.github.com/users/thefliik/events{/privacy}","received_events_url":"https://api.github.com/users/thefliik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-19T14:02:41Z","updated_at":"2017-09-20T12:08:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In my app, I'd like clients to provide enum params in all caps ([a convention](https://stackoverflow.com/a/3069863/5490505) I think is fairly common?). Currently, in order to accomplish this most easily, I'd need to have `enum property: [:VALUE_ONE, :VALUE_TWO]` which results in methods `Model.VALUE_ONE` or `Model.prefix_VALUE_ONE` which doesn't feel very Ruby esque. \r\n\r\nWould you accept a pull request to add a new option to `enum` of `_case_insensitive: true`? If enabled, this would downcase params before matching them against possible enum values. It would allow `enum property: [:value_one, :value_two], _case_insensitive: true` to match against `Model.create(property: 'VALUE_TWO')`.\r\n\r\nLooks like this change would involve updates to [EnumConverter](https://github.com/neo4jrb/neo4j/blob/2b7caed832b0db7ff7b578fd48d5066d17350043/lib/neo4j/shared/type_converters.rb#L298) and ~[Neo4j::Shared::Enum::ClassMethods](https://github.com/neo4jrb/neo4j/blob/2b7caed832b0db7ff7b578fd48d5066d17350043/lib/neo4j/shared/enum.rb#L85)\r\n"},"comment":{"url":"https://api.github.com/repos/neo4jrb/neo4j/issues/comments/330831569","html_url":"https://github.com/neo4jrb/neo4j/issues/1418#issuecomment-330831569","issue_url":"https://api.github.com/repos/neo4jrb/neo4j/issues/1418","id":330831569,"user":{"login":"thefliik","id":12599934,"avatar_url":"https://avatars3.githubusercontent.com/u/12599934?v=4","gravatar_id":"","url":"https://api.github.com/users/thefliik","html_url":"https://github.com/thefliik","followers_url":"https://api.github.com/users/thefliik/followers","following_url":"https://api.github.com/users/thefliik/following{/other_user}","gists_url":"https://api.github.com/users/thefliik/gists{/gist_id}","starred_url":"https://api.github.com/users/thefliik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thefliik/subscriptions","organizations_url":"https://api.github.com/users/thefliik/orgs","repos_url":"https://api.github.com/users/thefliik/repos","events_url":"https://api.github.com/users/thefliik/events{/privacy}","received_events_url":"https://api.github.com/users/thefliik/received_events","type":"User","site_admin":false},"created_at":"2017-09-20T12:08:12Z","updated_at":"2017-09-20T12:08:12Z","author_association":"CONTRIBUTOR","body":"That makes sense to me. Case-insensitive enums definitely seem like a sensible default. Lets move the convo over to #1419."}}
{"actor":{"display_login":"thefliik"}}