provide one-liner for counter_cache migration via rails g m

This commit is contained in:
Felix Wolfsteller committed 2017-04-18 15:57:48 +02:00
1 parent f38d4cdb73
commit ef3f9eab24
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