Sha256: ab110fc2d17597fa4b837897ac31ecccda0f4b33014a9fbfc3078376d747c80b

Contents?: true

Size: 292 Bytes

Versions: 1

Compression:

Stored size: 292 Bytes

Contents

module ActiveRecord
  module PGEnum
    module SchemaStatements
      def create_enum(name, *values)
        execute "CREATE TYPE #{name} AS ENUM (#{values.map { |v| "'#{v}'" }.join(", ")})"
      end

      def drop_enum(name)
        execute "DROP TYPE #{name}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-pg_enum-0.0.1 lib/active_record/pg_enum/schema_statements.rb