impressionist 1.4.10 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/impressionist/impressionable.rb +10 -6
- data/lib/impressionist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1bc58f25a7575987707c4e3c1db283b667c92def
|
4
|
+
data.tar.gz: 1366d3c96dc8d9f450df03b08e9dd4baca0352d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b443bea4b273f98ec4a62cc06e57ad8db6743c25789087d78058c1a9b22332daadcdcf88b64ff8fd5f74b477814afa8146a07b9219e29febc0dea4248a4e67eb
|
7
|
+
data.tar.gz: 6c56d18c5464fcbf7241e5a33a815c254db3194673535524c29eaa2733d0e99d09ed6cc63cde068de75fb8f5ca6cdf41bdbf1955c8e71193eb0e9725e0864b34
|
@@ -24,15 +24,19 @@ module Impressionist
|
|
24
24
|
|
25
25
|
end # end of ClassMethods
|
26
26
|
|
27
|
-
# ------------------------------------------
|
28
|
-
# TODO: CLEAN UP, make it HUMAN readable
|
29
27
|
def impressionist_count(options={})
|
30
|
-
options
|
31
|
-
|
28
|
+
# Uses these options as defaults unless overridden in options hash
|
29
|
+
options.reverse_merge!(:filter => :request_hash, :start_date => nil, :end_date => Time.now)
|
30
|
+
|
31
|
+
# If a start_date is provided, finds impressions between then and the end_date. Otherwise returns all impressions
|
32
|
+
imps = options[:start_date].blank? ? impressions : impressions.where("created_at >= ? and created_at <= ?", options[:start_date], options[:end_date])
|
33
|
+
|
34
|
+
# Count all distinct impressions unless the :all filter is provided.
|
35
|
+
distinct = options[:filter] != :all
|
32
36
|
if Rails::VERSION::MAJOR == 4
|
33
|
-
|
37
|
+
distinct ? imps.select(options[:filter]).distinct.count : imps.count
|
34
38
|
else
|
35
|
-
|
39
|
+
distinct ? imps.count(options[:filter], :distinct => true) : imps.count
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: impressionist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnmcaliley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|