Sha256: cf503b9d28546e200410d66fb31d11fca336628a8aed8857372e9c3aada49126

Contents?: true

Size: 396 Bytes

Versions: 2

Compression:

Stored size: 396 Bytes

Contents

module HasUuid
  module ActiveRecord
    module ConnectionAdapters
      module Migration
        def uuid(*column_names)
          options = column_names.extract_options!
          column_names.each do |name|
            type = @base.adapter_name.downcase == 'postgresql' ? 'uuid' : 'binary(16)'
            column(name, "#{type}", options)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_has_uuid-0.3.0 lib/has_uuid/active_record/connection_adapters/migration.rb
rails_has_uuid-0.2.0 lib/has_uuid/active_record/connection_adapters/migration.rb