Class: PgPartitioning::Strategies::Step

Inherits:
Base
  • Object
show all
Defined in:
lib/pg_partitioning/strategies/step.rb

Constant Summary

Constants included from Printer

Printer::COLORS

Instance Method Summary collapse

Methods inherited from Base

#initialize, #partitioning!

Methods included from Printer

#alert, #info, #message, #print_row, #text_color

Constructor Details

This class inherits a constructor from PgPartitioning::Strategies::Base

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
16
# File 'lib/pg_partitioning/strategies/step.rb', line 7

def valid?
  if super
    @error_message = if !@data_type.include? 'integer'
                       I18n.t "pg_partitioning.failure.column_type"
                     elsif @cond.blank?
                       I18n.t "pg_partitioning.failure.blank_cond"
                     end
  end
  @error_message.blank?
end