Module: ActiveRecord::Turntable::ConnectionProxy::Mixable
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveRecord::Turntable::ConnectionProxy
- Defined in:
- lib/active_record/turntable/connection_proxy/mixable.rb
Constant Summary collapse
- METHODS_REGEXP =
/\A(insert|select|update|delete|exec_)/
- EXCLUDE_QUERY_REGEXP =
/\A\s*SHOW/i
- QUERY_REGEXP =
/\A\s*(INSERT|DELETE|UPDATE|SELECT)/i
Instance Method Summary collapse
Instance Method Details
#mixable?(method, *args) ⇒ Boolean
10 11 12 13 14 |
# File 'lib/active_record/turntable/connection_proxy/mixable.rb', line 10 def mixable?(method, *args) (method.to_s =~ METHODS_REGEXP && args.first !~ EXCLUDE_QUERY_REGEXP) || (method.to_s == "execute" && args.first =~ QUERY_REGEXP) end |