module Army::Negative::MysqlAdapter

Constants

QUOTED_TRUE_AS_NEGATIVE_ONE

Effectively replaces ActiveRecord::ConnectionAdapters::MysqlAdapter::QUOTED_TRUE

Public Class Methods

included(klass) click to toggle source

Called when this module is included in ActiveRecord::ConnectionAdapters::MysqlAdapter. Uses alias_method to replace the original quoted_true implementation with this module’s implementation named quoted_true_as_negative_one

# File lib/army-negative/mysql_adapter.rb, line 14
def self.included(klass)
  klass.instance_eval do
    alias_method :quoted_true, :quoted_true_as_negative_one
  end
end

Public Instance Methods

quoted_true_as_negative_one() click to toggle source

Replaces the original quoted_true implementation. When asked for a “quoted_true” value, return our variation (QUOTED_TRUE_AS_NEGATIVE_ONE) instead of the default QUOTED_TRUE value.

# File lib/army-negative/mysql_adapter.rb, line 25
def quoted_true_as_negative_one
  QUOTED_TRUE_AS_NEGATIVE_ONE
end