Commit bb96502a4d14ac46fb3ebea9091d460f59e5fed3
1 parent
95282c4f
Exists in
master
and in
17 other branches
Moved last section
Showing
1 changed file
with
6 additions
and
8 deletions
Show diff stats
README.md
@@ -107,6 +107,12 @@ To get a specific time range, use: | @@ -107,6 +107,12 @@ To get a specific time range, use: | ||
107 | User.group_by_day(:created_at, range: 2.weeks.ago.midnight..Time.now).count | 107 | User.group_by_day(:created_at, range: 2.weeks.ago.midnight..Time.now).count |
108 | ``` | 108 | ``` |
109 | 109 | ||
110 | +[master] To get the last N time periods from the current time, use: | ||
111 | + | ||
112 | +```ruby | ||
113 | +User.group_by_week(:created_at, last: 8).count # last 8 weeks | ||
114 | +``` | ||
115 | + | ||
110 | ### Order | 116 | ### Order |
111 | 117 | ||
112 | You can order in descending order with: | 118 | You can order in descending order with: |
@@ -121,14 +127,6 @@ or | @@ -121,14 +127,6 @@ or | ||
121 | User.group_by_day(:created_at).order("day desc").count | 127 | User.group_by_day(:created_at).order("day desc").count |
122 | ``` | 128 | ``` |
123 | 129 | ||
124 | -### Last [master] | ||
125 | - | ||
126 | -Get the last N time periods from the current time. | ||
127 | - | ||
128 | -```ruby | ||
129 | -User.group_by_week(:created_at, last: 8).count # last 8 weeks | ||
130 | -``` | ||
131 | - | ||
132 | ## Installation | 130 | ## Installation |
133 | 131 | ||
134 | Add this line to your application’s Gemfile: | 132 | Add this line to your application’s Gemfile: |