Module: ActiveRecord::ConnectionAdapters::PostgreSQL::ColumnMethods
- Defined in:
- lib/enum_kit/active_record_patches/connection_adapters/postgresql/column_methods.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#enum(name, options = {}) ⇒ Object
Create an enum column with the provided name.
Instance Method Details
#enum(name, options = {}) ⇒ Object
Create an enum column with the provided name.
By default, the enum type will match the name of the column. You can change this behaviour by providing the enum type as an option under the ‘:enum_type` key.
26 27 28 |
# File 'lib/enum_kit/active_record_patches/connection_adapters/postgresql/column_methods.rb', line 26 def enum(name, = {}) column(name, [:enum_type] || name, .except(:enum_type)) end |