Closed AndrewSpeed closed 5 years ago
@AndrewSpeed thanks for the bug report, I hadn't even considered making enums with spaces, but you're absolutely right that they are allowed.
If you'd like to take a crack at this, it shouldn't be very difficult; the code is here: https://github.com/alassek/activerecord-pg_enum/blob/master/lib/active_record/pg_enum/4.1/schema_dumper.rb#L22 Otherwise I can handle it
👍 thanks for the response @alassek, I'll have a go at this and let you know if I run into any problems
Fixed in v1.0.3
Hi 👋
I've been using
activerecord-pg_enum
for a few weeks now, it's a fantastic gem, thanks for writing it.Today I was adding a migration to create an enum which has values containing spaces, but the dumper doesn't appear to handle this correctly.
I've been taking a look at the codebase and would be happy to try and make this change, assuming it's deemed valid.
Steps to reproduce
Rails version: 5.2.2.1 Ruby version: 2.6.3 activerecord-pg_enum version: 1.0.2
Migration
Schema
Expected Schema
Actual Schema
This ☝️will lead to the enum being created with values
["sick", "on", "vacation", "working", "from", "home"]