module Sequel

Rather than re-writing the whole save method and all the hooks and validation logic in it, it naughtily overrides the private _insert_dataset.

Public Class Methods

name_like(column_name, value) click to toggle source

For matching identifying names based on the :use_case_sensitive_resource_names config setting. This has been used inconsistently, and in the next major version, support for case insensitive names will be dropped.

# File lib/pact_broker/dataset.rb, line 110
def self.name_like(column_name, value)
  if PactBroker.configuration.use_case_sensitive_resource_names
    if PactBroker::Dataset::Helpers.mysql?
      # sigh, mysql, this is the only way to perform a case sensitive search
      Sequel.like(column_name, PactBroker::Dataset::Helpers.escape_wildcards(value), { case_insensitive: false })
    else
      { column_name => value }
    end
  else
    Sequel.like(column_name, PactBroker::Dataset::Helpers.escape_wildcards(value), { case_insensitive: true })
  end
end