Sha256: 49b7c0b7138636856546dc80067f3ce487410448f94664a8fcfa4fb9aff6a46c
Contents?: true
Size: 616 Bytes
Versions: 11
Compression:
Stored size: 616 Bytes
Contents
module CassandraObject module Scoping extend ActiveSupport::Concern included do singleton_class.class_eval do delegate :find, :find_by_id, :first, :all, to: :scope delegate :find_each, :find_in_batches, to: :scope delegate :select, :where, to: :scope end end module ClassMethods def scope self.current_scope ||= Scope.new(self) end def current_scope Thread.current["#{self}_current_scope"] end def current_scope=(new_scope) Thread.current["#{self}_current_scope"] = new_scope end end end end
Version data entries
11 entries across 11 versions & 1 rubygems