Module: ActiverecordCoveringIndex::IndexDefinition

Defined in:
lib/activerecord-covering-index/index_definition.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
# File 'lib/activerecord-covering-index/index_definition.rb', line 5

def self.prepended(base)
  base.attr_reader :include
end

Instance Method Details

#initialize(table, name, unique = false, columns = [], lengths: {}, orders: {}, opclasses: {}, where: nil, type: nil, using: nil, comment: nil, include: []) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/activerecord-covering-index/index_definition.rb', line 9

def initialize(
  table, name,
  unique = false,
  columns = [],
  lengths: {},
  orders: {},
  opclasses: {},
  where: nil,
  type: nil,
  using: nil,
  comment: nil,
  include: []
)
  @table = table
  @name = name
  @unique = unique
  @columns = columns
  @lengths = concise_options(lengths)
  @orders = concise_options(orders)
  @opclasses = concise_options(opclasses)
  @where = where
  @type = type
  @using = using
  @comment = comment
  @include = include
end