timescopes 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/timescopes/rails/active_record_extension.rb +1 -1
- data/lib/timescopes/scopes.rb +3 -2
- data/timescopes.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98a6efb52f14903fc708521eae295b3fc4b09967
|
4
|
+
data.tar.gz: a3227af5899a4cd61cd051b8238aba93854b2f56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71d88f8a40c71b06d2faaa70dfa8d99981a174464b9655c5f33e0077d8f60d332af89d98815672836c30f7fbaf026fc49f1ee3487cf33d90d3723e9362efd779
|
7
|
+
data.tar.gz: 022f1bb08842a7289488d9268a67309a8471a3d34d66a41fed357c1441db24514f116470793d932e8cdc5d1ce9f44e87511785dd9d5c9c99d364e00dcb3eac91
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
@@ -5,7 +5,7 @@ module TimeScopes
|
|
5
5
|
|
6
6
|
module ClassMethods
|
7
7
|
def timescoped!(opts={})
|
8
|
-
default_scopes = [:minutely, :hourly, :daily, :weekly, :monthly]
|
8
|
+
default_scopes = [:minutely, :hourly, :daily, :weekly, :monthly, :yearly, :total]
|
9
9
|
|
10
10
|
field = opts[:field] || "created_at"
|
11
11
|
scopes = if opts[:only]
|
data/lib/timescopes/scopes.rb
CHANGED
@@ -18,7 +18,7 @@ module TimeScopes
|
|
18
18
|
1.year.since(start).utc
|
19
19
|
when :rolling_7, :rolling_30
|
20
20
|
1.day.since(start).utc
|
21
|
-
when :overall, nil
|
21
|
+
when :total, :overall, nil
|
22
22
|
nil
|
23
23
|
else
|
24
24
|
raise "Unknown scope passed to TimeScopes.next_range"
|
@@ -70,9 +70,10 @@ module TimeScopes
|
|
70
70
|
alias_method :year, :yearly
|
71
71
|
|
72
72
|
def overall(start=nil)
|
73
|
-
[ Chronic.parse('2000-01-01 00:00:
|
73
|
+
[ Chronic.parse('2000-01-01 00:00:00Z'),
|
74
74
|
Chronic.parse(start_of_day(1.day.from_now.utc)) ]
|
75
75
|
end
|
76
|
+
alias_method :total, :overall
|
76
77
|
|
77
78
|
def start_of_minute(time)
|
78
79
|
time.strftime("%Y-%m-%d %H:%M:00Z")
|
data/timescopes.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: timescopes 0.1.
|
5
|
+
# stub: timescopes 0.1.8 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "timescopes"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.8"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|