Module: ActiveRecord::PGEnum::TableDefinition
- Defined in:
- lib/active_record/pg_enum/4.1/table_definition.rb,
lib/active_record/pg_enum/6.0/table_definition.rb
Instance Method Summary collapse
-
#enum(name, as:, **options) ⇒ Object
Create an enum column inside a TableDefinition.
Instance Method Details
#enum(name, as:, **options) ⇒ Object
Create an enum column inside a TableDefinition
Example:
create_table :orders do |t|
t.enum :status, as: "status_type"
end
17 18 19 |
# File 'lib/active_record/pg_enum/4.1/table_definition.rb', line 17 def enum(name, as:, **) column(name, as, ) end |