Module: NoBrainer::Criteria::Count
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/no_brainer/criteria/count.rb
Instance Method Summary collapse
Instance Method Details
#any? ⇒ Boolean
12 13 14 15 16 17 18 |
# File 'lib/no_brainer/criteria/count.rb', line 12 def any? if block_given? to_a.any? { |*args| yield(*args) } else !empty? end end |
#count ⇒ Object
4 5 6 |
# File 'lib/no_brainer/criteria/count.rb', line 4 def count run { without_ordering.without_plucking.to_rql.count } end |
#empty? ⇒ Boolean
8 9 10 |
# File 'lib/no_brainer/criteria/count.rb', line 8 def empty? count == 0 end |