code formatting

This commit is contained in:
John McAliley 2011-11-27 23:43:30 -05:00
parent 623a1ae9e6
commit 792cbf9743
1 changed files with 3 additions and 3 deletions

View File

@ -110,15 +110,15 @@ Adding a counter cache
---------------------- ----------------------
Impressionist makes it easy to add a `counter_cache` column to your model. The most basic configuration looks like: Impressionist makes it easy to add a `counter_cache` column to your model. The most basic configuration looks like:
is_impressionable :counter_cache => true is_impressionable :counter_cache => true
This will automatically increment the `impressions_count` column in the included model. Note: You'll need to add that column to your model. If you'd like specific a different column name, you can: This will automatically increment the `impressions_count` column in the included model. Note: You'll need to add that column to your model. If you'd like specific a different column name, you can:
is_impressionable :counter_cache => { :column_name => :my_column } is_impressionable :counter_cache => { :column_name => :my_column }
If you'd like to include only unique impressions in your count: If you'd like to include only unique impressions in your count:
is_impressionable :counter_cache => { :column_name => :my_column, :unique => true } is_impressionable :counter_cache => { :column_name => :my_column, :unique => true }
What if I only want to record unique impressions? What if I only want to record unique impressions?