Sha256: af2d72da6498bcd4c98a150809b6aa7be45c944cba83f25c1dcb8357cf94d866

Contents?: true

Size: 619 Bytes

Versions: 2

Compression:

Stored size: 619 Bytes

Contents

require 'active_record/schema_dumper'

module ActiveRecord
  class SchemaDumper #:nodoc:
    private

    alias table_without_awesome table
    def table(table, stream)
      @types = @types.merge(@connection.options_for_column_spec(table))
      if table_options = @connection.table_options(table)
        buf = StringIO.new
        table_without_awesome(table, buf)
        stream.print buf.string.sub(/(?= do \|t\|)/, ", options: #{table_options.inspect}")
        stream
      else
        table_without_awesome(table, stream)
      end
    ensure
      @types = @connection.native_database_types
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activerecord-mysql-awesome-0.0.2 lib/activerecord-mysql-awesome/active_record/schema_dumper.rb
activerecord-mysql-awesome-0.0.1 lib/activerecord-mysql-awesome/active_record/schema_dumper.rb