Sha256: a6b0962cf422ee3eb1c78f80383203a5d994053b04836b6edf9b46e197ffaf94

Contents?: true

Size: 495 Bytes

Versions: 23

Compression:

Stored size: 495 Bytes

Contents

module ActiveRecord::Turntable
  class ConnectionProxy
    module Mixable
      extend ActiveSupport::Concern

      METHODS_REGEXP = /\A(insert|select|update|delete|exec_)/
      EXCLUDE_QUERY_REGEXP = /\A\s*SHOW/i
      QUERY_REGEXP = /\A\s*(INSERT|DELETE|UPDATE|SELECT)/i

      def mixable?(method, *args)
        (method.to_s =~ METHODS_REGEXP &&
         args.first !~ EXCLUDE_QUERY_REGEXP) ||
          (method.to_s == 'execute' && args.first =~ QUERY_REGEXP)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
activerecord-turntable-2.5.0 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.4.0 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.3.3 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.3.2 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.3.1 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.3.0 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.2.2 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.2.1 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.2.0 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.1 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.0 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.0.rc2 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.0.rc1 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.0.beta2 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.1.0.beta1 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.0.6 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.0.5 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.0.4 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.0.3 lib/active_record/turntable/connection_proxy/mixable.rb
activerecord-turntable-2.0.2 lib/active_record/turntable/connection_proxy/mixable.rb