hightop 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/hightop/version.rb +1 -1
- data/lib/hightop.rb +2 -2
- 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: bf96c83a04ca95ac0845fd2ac5b529448fa4ca80
|
4
|
+
data.tar.gz: 3c78e087b0b7f3e0deff1af1cbddd63c7d34dd71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f49812c1ab004e8d83f03eff55ce001e6fceb1344e577400ab1479f4121c2dddaa1e7a6d879782b2fb4f6a0c3572984e835d2c6f6f54b4917e81fbcad0d9b7c3
|
7
|
+
data.tar.gz: c39a26e313e575df9d968778d580b3008aaca8e4089129dd2197dc511bcd17e3da0ce511f7d9f855441f6c91feb8f93c61ccdfc7ec2ad835d7a4824bf3f298a4
|
data/README.md
CHANGED
@@ -3,19 +3,19 @@
|
|
3
3
|
Super convenient group count
|
4
4
|
|
5
5
|
```ruby
|
6
|
-
|
6
|
+
Visit.top(:browser)
|
7
7
|
```
|
8
8
|
|
9
9
|
instead of
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
|
12
|
+
Visit.group(:browser).where("browser IS NOT NULL").order("count_all DESC, browser").count
|
13
13
|
```
|
14
14
|
|
15
15
|
Limit the results
|
16
16
|
|
17
17
|
```ruby
|
18
|
-
Visit.
|
18
|
+
Visit.top(:referring_domain, 10)
|
19
19
|
```
|
20
20
|
|
21
21
|
## Installation
|
data/lib/hightop/version.rb
CHANGED
data/lib/hightop.rb
CHANGED
@@ -2,9 +2,9 @@ require "hightop/version"
|
|
2
2
|
|
3
3
|
module Hightop
|
4
4
|
|
5
|
-
def top(column)
|
5
|
+
def top(column, limit = nil)
|
6
6
|
column = connection.quote_table_name(column)
|
7
|
-
group(column).where("#{column} IS NOT NULL").order("count_all DESC, #{column}").count
|
7
|
+
group(column).where("#{column} IS NOT NULL").order("count_all DESC, #{column}").limit(limit).count
|
8
8
|
end
|
9
9
|
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hightop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|