Merge pull request #239 from econya/doc-COUNTER_CACHE_VIA_RAILSGMIGRATION

Readme: add `rails g migration` example for counter_cache for model
This commit is contained in:
Jonas Grau 2017-04-28 08:12:10 +02:00 committed by GitHub
commit efc7a54d09
1 changed files with 4 additions and 0 deletions

View File

@ -175,6 +175,10 @@ It is as simple as this:
t.integer :my_column_name, :default => 0
If you want to use the typical Rails 4 migration generator, you can:
rails g migration AddImpressionsCountToBook impressions_count:int
What if I only want to record unique impressions?
-------------------------------------------------
Maybe you only care about unique impressions and would like to avoid