Sha256: dbba27a7665c909717dc7371aa5f5c1304e636abbd6a4ed4cb62550583725ba2

Contents?: true

Size: 541 Bytes

Versions: 20

Compression:

Stored size: 541 Bytes

Contents

module Sequel
  module ActiveRecordConnection
    module Utils
      def self.set_value(object, name, new_value)
        original_value = object.send(name)
        object.send(:"#{name}=", new_value)
        yield
      ensure
        object.send(:"#{name}=", original_value)
      end

      def self.add_prepared_statements_cache(conn)
        return if conn.respond_to?(:prepared_statements)

        class << conn
          attr_accessor :prepared_statements
        end
        conn.prepared_statements = {}
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
sequel-activerecord_connection-2.0.0 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.5.1 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.5.0 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.4.3 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.4.2 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.4.0 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.3.1 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.3.0 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.11 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.10 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.9 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.8 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.7 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.6 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.5 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.4 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.3 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.2 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.1 lib/sequel/extensions/activerecord_connection/utils.rb
sequel-activerecord_connection-1.2.0 lib/sequel/extensions/activerecord_connection/utils.rb