module Card::Query::CardClass
query-related methods with which to extend Card
class
Public Instance Methods
Source
# File lib/card/query/card_class.rb, line 11 def count_by_cql spec spec = spec.clone spec.delete(:offset) search spec.merge(return: "count") end
Source
# File lib/card/query/card_class.rb, line 17 def find_each **options, &block # this is a copy from rails (3.2.16) and is needed because this # is performed by a relation (ActiveRecord::Relation) find_in_batches(**options) do |records| records.each(&block) end end
Source
# File lib/card/query/card_class.rb, line 25 def find_in_batches **options if block_given? super do |records| yield(records) Card::Cache.reset_temp end else super end end
Calls superclass method
Source
# File lib/card/query/card_class.rb, line 5 def search spec, comment=nil, &block results = ::Card::Query.run(spec, comment) results.each(&block) if block_given? && results.is_a?(Array) results end