Monkey patch PostgreSQLAdapter to make enums work
This commit is contained in:
parent
984c6dc114
commit
36c220ca2b
1 changed files with 13 additions and 0 deletions
|
@ -59,6 +59,19 @@ if defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
|
|||
nil
|
||||
end
|
||||
end
|
||||
|
||||
class PostgreSQLColumn
|
||||
def simplified_type_with_enum(field_type)
|
||||
case field_type
|
||||
when /_enum$/
|
||||
:string
|
||||
else
|
||||
simplified_type_without_enum(field_type)
|
||||
end
|
||||
end
|
||||
|
||||
alias_method_chain :simplified_type, :enum
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue