From ef3f9eab247dc1e66c0ce8e7ba2f8466051a7fa6 Mon Sep 17 00:00:00 2001 From: Felix Wolfsteller Date: Tue, 18 Apr 2017 15:57:48 +0200 Subject: [PATCH] provide one-liner for counter_cache migration via rails g m --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 52d7ae8..198dac2 100644 --- a/README.md +++ b/README.md @@ -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