Class: CodeKindly::Utils::SQL

Inherits:
Object
  • Object
show all
Defined in:
lib/code_kindly/utils/s_q_l.rb

Class Method Summary collapse

Class Method Details

.method_missing(method, *args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/code_kindly/utils/s_q_l.rb', line 5

def method_missing (method, *args)
  method_name = method.to_s
  return process(method_name, *args) if respond_to_missing?(method_name)
  select_method_name = "select_" + method_name
  return process(select_method_name, *args) if respond_to_missing?(select_method_name)
  super
end

.respond_to_missing?(method, _include_all = false) ⇒ Boolean

Returns:



13
14
15
# File 'lib/code_kindly/utils/s_q_l.rb', line 13

def respond_to_missing? (method, _include_all = false)
  default_connection_class && default_connection_class.connection.respond_to?(method)
end