Skip to content

simon-engledew/count-by-month

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

CountByMonth
============

Adds a class method to ActiveRecord::Base that will count records by month.


Example
=======

Post.count_by_month
=> {Wed, 01 Oct 2008=>2, Mon, 01 Sep 2008=>1, Sun, 01 Jun 2008=>1}

Post.count_by_month(:conditions => {:user_id => User.first})
=> {Wed, 01 Oct 2008=>2, Mon, 01 Sep 2008=>1}

@author.posts.count_by_month
=> {Wed, 01 Oct 2008=>2, Mon, 01 Sep 2008=>1}



Copyright (c) 2008 Simon Engledew, released under the MIT license

About

Adds an ActiveRecord class method to count records by the month they were created.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages