Skip to content

Commit

Permalink
A minor tweak to the README
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed May 28, 2009
1 parent 8573323 commit 1722907
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.markdown
Expand Up @@ -6,12 +6,12 @@ This ActiverRecord plugin allows you to easily define and pull statistics for AR
script/plugin install git://github.com/acatighera/statistics.git

## Examples
#### Defining statistics is similar to defining named scopes:
#### Defining statistics is similar to defining named scopes. Strings and symbols both work as names.

class Account < ActiveRecord::Base
define_statistic :user_count, :count => :all
define_statistic :average_age, :average => :all, :column_name => 'age'
define_statistic :subscriber_count, :count => :all, :conditions => "subscription_opt_in = 1"
define_statistic 'subscriber count', :count => :all, :conditions => "subscription_opt_in = 1"
end

class Donations < ActiveRecord::Base
Expand All @@ -22,7 +22,7 @@ This ActiverRecord plugin allows you to easily define and pull statistics for AR

#####for all stats

Account.statistics # returns { :user_count => 120, :average_age => 28, :subscriber_count => 74 }
Account.statistics # returns { :user_count => 120, :average_age => 28, 'subscriber count' => 74 }

#####for a single stat

Expand Down

0 comments on commit 1722907

Please sign in to comment.