Sha256: 52eaf666332188e2495a936482061e7e7e1b1633fe304647b07a126d4a370308
Contents?: true
Size: 648 Bytes
Versions: 7
Compression:
Stored size: 648 Bytes
Contents
module ActiveRecord module PGEnum register :table_definition do require "active_record/connection_adapters/postgresql_adapter" ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition.include TableDefinition ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Table.include TableDefinition end module TableDefinition # Create an enum column inside a TableDefinition # # Example: # # create_table :orders do |t| # t.enum :status, as: "status_type" # end def enum(name, as:, **options) column(name, as, options) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems