datamapper / dm-types

DataMapper plugin providing extra data types
http://datamapper.org/
MIT License
55 stars 80 forks source link

Cast empty string to nil in enum #75

Closed FeeJai closed 9 years ago

FeeJai commented 9 years ago

When using webforms we do have empty Strings quite often as a result in optional Selects. This pr fixes the exception in Datamapper

postmodern commented 9 years ago

This is something that should be done at the param parser level. There are instances when you want to store empty Strings. Maybe a better solution would be to check !allow_blank? && allow_nil?.