Sha256: 0de1e5ab7fc79d6459d45d3735dcf7c2fe728fff1f3f6474d1b5b139ac41efb6

Contents?: true

Size: 522 Bytes

Versions: 2

Compression:

Stored size: 522 Bytes

Contents

module ByStar
  module Calculations
    module Count
      def count_by_year(field=nil, year=Time.now.year, options={})
        count(field, :conditions => conditions_for_range(start_of_year(year), end_of_year(year), options))
      end
      
      def count_by_month(field=nil, month=Time.now.month, options={})
        year, month = work_out_month(month, options)
        count(field, :conditions => conditions_for_range(start_of_month(month, year), end_of_month(month, year), options))
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
by_star-0.3.1 lib/calculations/count.rb
by_star-0.3.0 lib/calculations/count.rb