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.



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

def check_constraints
  @check_constraints
end

Instance Method Details

#check_constraint(name_or_conditions, conditions = nil) ⇒ Object



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

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