bibendi / activerecord-postgres_enum

Integrate PostgreSQL's enum data type into ActiveRecord's schema and migrations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Symbols?

sam0x17 opened this issue · comments

My expectation when using this gem was that the values would be automatically returned as symbols, however strings are used by default.

If I submit a pull request that adds the option to have enums be automatically returned as symbols, and make this option configurable and off by default, would that be reasonable, or are you against that line of thinking?

Hi!
Sounds good!

I think it is here

class Enum < Type::Value # :nodoc:
attr_reader :enum_name
def initialize(enum_name:, **kwargs)
@enum_name = enum_name.to_sym
super(**kwargs)
end
end

I have no more guesses :)