lib/pg_trunk/operations/domains/change_domain.rb
# Methods to populate `constraints` from the block
Methods to populate `constraints` from the block
Methods to populate ` constraints ` from the block
def invert
      keys = inversion.select { |_, v| v.nil? }.keys.join(", ").presence
      errors = constraints.map(&:inversion_error).compact
      errors << "Can't invert #{keys}" if keys.present?
      raise IrreversibleMigration.new(self, nil, *errors) if errors.any?
      self.class.new(**to_h, **inversion)
    end
def invert keys = inversion . select { | _ , v | v . nil? } . keys . join ( ", " ) . presence errors = constraints . map ( & :inversion_error ) . compact errors << "Can't invert #{keys}" if keys . present? raise IrreversibleMigration . new ( self , nil , * errors ) if errors . any? self . class . new ( ** to_h , ** inversion ) end
Methods to populate `constraints` from the block
Methods to populate ` constraints ` from the block