Sha256: 584b7e273ce65f35571a2ce818471a41099161667a25f2fcb2980b400e144deb

Contents?: true

Size: 528 Bytes

Versions: 8

Compression:

Stored size: 528 Bytes

Contents

module SchemaPlus::Enums
  module Middleware

    module Dumper
      module Initial

        module Postgresql

          def after(env)
            env.connection.enums.sort_by(&its[1]).each do |schema, name, values|
              params = [name.inspect]
              params << values.map(&:inspect).join(', ')
              params << ":schema => #{schema.inspect}" if schema != 'public'

              env.initial << "  create_enum #{params.join(', ')}"
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
schema_plus_enums-0.1.8 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.7 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.6 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.5 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.4 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.3 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.2 lib/schema_plus/enums/middleware.rb
schema_plus_enums-0.1.1 lib/schema_plus/enums/middleware.rb