Module: ActiveRecord::Postgres::Constraints::TableDefinition

Defined in:
lib/active_record/postgres/constraints/table_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#check_constraintsObject (readonly)

Returns the value of attribute check_constraints.



6
7
8
# File 'lib/active_record/postgres/constraints/table_definition.rb', line 6

def check_constraints
  @check_constraints
end

Instance Method Details

#check_constraint(name_or_conditions, conditions = nil) ⇒ Object



8
9
10
11
12
# File 'lib/active_record/postgres/constraints/table_definition.rb', line 8

def check_constraint(name_or_conditions, conditions = nil)
  @check_constraints ||= []
  constraint = Constraints.to_sql(name, name_or_conditions, conditions)
  check_constraints << constraint
end