Flowdock
method

index_parts

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveRecord::SchemaDumper
index_parts(index) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/schema_dumper.rb, line 216
      def index_parts(index)
        index_parts = [
          index.columns.inspect,
          "name: #{index.name.inspect}",
        ]
        index_parts << 'unique: true' if index.unique

        index_lengths = (index.lengths || []).compact
        index_parts << "length: #{Hash[index.columns.zip(index.lengths)].inspect}" if index_lengths.any?

        index_orders = index.orders || {}
        index_parts << "order: #{index.orders.inspect}" if index_orders.any?
        index_parts << "where: #{index.where.inspect}" if index.where
        index_parts << "using: #{index.using.inspect}" if index.using
        index_parts << "type: #{index.type.inspect}" if index.type
        index_parts << "comment: #{index.comment.inspect}" if index.comment
        index_parts
      end
Register or log in to add new notes.