class MysqlMaxValue

Constants

TYPES
VERSION

Public Class Methods

method_missing(name) click to toggle source
# File lib/mysql_max_value.rb, line 22
def method_missing(name)
  if TYPES.keys.include? name
    class_variable_get("@@#{name}".to_sym) || class_variable_set("@@#{name}".to_sym, max_value(TYPES[name]))
  end
end

Private Class Methods

max_value(shift_bit) click to toggle source
# File lib/mysql_max_value.rb, line 30
def max_value(shift_bit)
  ActiveRecord::Base.connection.execute("SELECT ~0 >> #{shift_bit}").first[0]
rescue
end