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 authored and GitHub committed 2017-04-28 08:12:10 +02:00
commit efc7a54d09
1 file changed
+4
+4
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