hightop 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf96c83a04ca95ac0845fd2ac5b529448fa4ca80
4
- data.tar.gz: 3c78e087b0b7f3e0deff1af1cbddd63c7d34dd71
3
+ metadata.gz: 4f282f1928e3686e3b51e376e64c6caa727665dd
4
+ data.tar.gz: 6c8614fee9db943bc7b0c6ad8c65576116ffc9f4
5
5
  SHA512:
6
- metadata.gz: f49812c1ab004e8d83f03eff55ce001e6fceb1344e577400ab1479f4121c2dddaa1e7a6d879782b2fb4f6a0c3572984e835d2c6f6f54b4917e81fbcad0d9b7c3
7
- data.tar.gz: c39a26e313e575df9d968778d580b3008aaca8e4089129dd2197dc511bcd17e3da0ce511f7d9f855441f6c91feb8f93c61ccdfc7ec2ad835d7a4824bf3f298a4
6
+ metadata.gz: b3c0135aebba9a186fdb2ab91e0f5d792c3c5d132305ae3b799c8a16b24a0239597b79d771d5e704e095602a0d048a084b41e2e2273b43c26a712435353534f5
7
+ data.tar.gz: ce487ed0b6cef4b566a35ae92c83403ac597cd608a1a52222e1de99914e415505e1356da82aa88fd839e125ddba43a6ea3f3d3298687d58deb4c4c1da14235a8
data/README.md CHANGED
@@ -18,6 +18,8 @@ Limit the results
18
18
  Visit.top(:referring_domain, 10)
19
19
  ```
20
20
 
21
+ Be sure to [sanitize user input](http://rails-sqli.org/) like you must with `group`.
22
+
21
23
  ## Installation
22
24
 
23
25
  Add this line to your application’s Gemfile:
@@ -1,3 +1,3 @@
1
1
  module Hightop
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/hightop.rb CHANGED
@@ -3,7 +3,7 @@ require "hightop/version"
3
3
  module Hightop
4
4
 
5
5
  def top(column, limit = nil)
6
- column = connection.quote_table_name(column)
6
+ column = connection.quote_table_name(column) if column.is_a?(Symbol)
7
7
  group(column).where("#{column} IS NOT NULL").order("count_all DESC, #{column}").limit(limit).count
8
8
  end
9
9
 
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.2
4
+ version: 0.0.3
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-29 00:00:00.000000000 Z
11
+ date: 2014-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler