module ActiveRecord::Postgres::Constraints

Constants

CONSTRAINT_TYPES
VERSION

Public Class Methods

class_for_constraint_type(type) click to toggle source
# File lib/active_record/postgres/constraints.rb, line 11
def self.class_for_constraint_type(type)
  'ActiveRecord::Postgres::Constraints::Types::'\
  "#{type.to_s.classify}".constantize
end
normalize_name_and_conditions(table, name_or_conditions, conditions) click to toggle source
# File lib/active_record/postgres/constraints.rb, line 16
def self.normalize_name_and_conditions(table, name_or_conditions, conditions)
  return [name_or_conditions, conditions] if conditions

  ["#{table}_#{Time.zone.now.nsec}", name_or_conditions]
end