Class: ActiveRecord::ConnectionAdapters::TableDefinition
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::TableDefinition
- Defined in:
- lib/monkey_patch_postgres.rb
Overview
Patches associated with building check constraints.
Instance Method Summary collapse
-
#check_constraint(constraint) ⇒ Object
Builds a SQL check constraint.
Instance Method Details
#check_constraint(constraint) ⇒ Object
Builds a SQL check constraint
20 21 22 |
# File 'lib/monkey_patch_postgres.rb', line 20 def check_constraint(constraint) @columns << Struct.new(:to_sql).new("CHECK (#{constraint})") end |