datescope 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -3
- data/lib/datescope/base.rb +2 -2
- data/lib/datescope/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -26,9 +26,12 @@ Or install it yourself as:
|
|
26
26
|
|
27
27
|
end
|
28
28
|
|
29
|
-
User.registered.today
|
30
|
-
User.registered.
|
31
|
-
User.registered.
|
29
|
+
User.registered.today
|
30
|
+
User.registered.this_week
|
31
|
+
User.registered.this_month
|
32
|
+
User.registered.last_month
|
33
|
+
User.registered.month_before_last_month
|
34
|
+
User.registered.this_year
|
32
35
|
|
33
36
|
|
34
37
|
## Contributing
|
data/lib/datescope/base.rb
CHANGED
@@ -14,11 +14,11 @@ module DateScope
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def last_month
|
17
|
-
where("created_at >= ? and
|
17
|
+
where("created_at >= ? and created_at <= ?", 1.month.ago.beginning_of_month, 1.month.ago.end_of_month)
|
18
18
|
end
|
19
19
|
|
20
20
|
def month_before_last_month
|
21
|
-
where("created_at >= ? and
|
21
|
+
where("created_at >= ? and created_at <= ?", 2.month.ago.beginning_of_month, 2.month.ago.end_of_month)
|
22
22
|
end
|
23
23
|
|
24
24
|
def this_year
|
data/lib/datescope/version.rb
CHANGED