hightop 0.4.0 → 0.6.0
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/CHANGELOG.md +10 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -13
- data/lib/hightop/enumerable.rb +1 -1
- data/lib/hightop/utils.rb +2 -2
- data/lib/hightop/version.rb +1 -1
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a64e0bb62da03d1937a7143266c6ebaa6354c1fd188c3e5dd2da2429bd2e0a5
|
4
|
+
data.tar.gz: d701bac1d646378488d7ee5c17836977de26549f8e5e78baf7e5298558e68395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e62486b1afdb3e2089def164569211fbc362a0a3ec01ac143bde06d4f3df81ad508b84ce0f582c94f2711928951885ce7ca6dbe16ff58b50f7d3228b206dcd7a
|
7
|
+
data.tar.gz: 57bf6ff4d8b439e0465c712574a49eda397287289d73585e858231f7bd4db30ed6246f45eb3e64a2cd77f1a4605f30aef5933387e33f1a8b32381686f167d1d8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
## 0.6.0 (2025-05-04)
|
2
|
+
|
3
|
+
- Dropped support for Active Record < 7.1 and Ruby < 3.2
|
4
|
+
- Dropped support for Mongoid < 8
|
5
|
+
|
6
|
+
## 0.5.0 (2024-10-07)
|
7
|
+
|
8
|
+
- Fixed connection leasing for Active Record 7.2+
|
9
|
+
- Dropped support for Active Record < 7 and Ruby < 3.1
|
10
|
+
|
1
11
|
## 0.4.0 (2023-07-02)
|
2
12
|
|
3
13
|
- Dropped support for Active Record < 6.1 and Ruby < 3
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -13,7 +13,7 @@ Visit.top(:browser)
|
|
13
13
|
|
14
14
|
Works with Active Record, Mongoid, arrays and hashes
|
15
15
|
|
16
|
-
[](https://github.com/ankane/hightop/actions)
|
17
17
|
|
18
18
|
## Installation
|
19
19
|
|
@@ -93,18 +93,6 @@ Min count
|
|
93
93
|
["up", "up", "down"].top(min: 2)
|
94
94
|
```
|
95
95
|
|
96
|
-
## Upgrading
|
97
|
-
|
98
|
-
### 0.3.0
|
99
|
-
|
100
|
-
Hightop 0.3.0 protects against unsafe input by default. For non-attribute arguments, use:
|
101
|
-
|
102
|
-
```ruby
|
103
|
-
Visit.top(Arel.sql(known_safe_value))
|
104
|
-
```
|
105
|
-
|
106
|
-
Also, the `uniq` option has been removed. Use `distinct` instead.
|
107
|
-
|
108
96
|
## History
|
109
97
|
|
110
98
|
View the [changelog](https://github.com/ankane/hightop/blob/master/CHANGELOG.md)
|
data/lib/hightop/enumerable.rb
CHANGED
@@ -17,7 +17,7 @@ module Enumerable
|
|
17
17
|
arr = arr[0...limit] if limit
|
18
18
|
Hash[arr]
|
19
19
|
elsif respond_to?(:scoping)
|
20
|
-
scoping {
|
20
|
+
scoping { klass.send(:top, *args, **options, &block) }
|
21
21
|
else
|
22
22
|
with_scope(self) { klass.send(:top, *args, **options, &block) }
|
23
23
|
end
|
data/lib/hightop/utils.rb
CHANGED
@@ -7,7 +7,7 @@ module Hightop
|
|
7
7
|
def validate_column(column)
|
8
8
|
unless column.is_a?(Symbol) || column.is_a?(Arel::Nodes::SqlLiteral)
|
9
9
|
column = column.to_s
|
10
|
-
unless /\A\w+(\.\w+)?\z/i.match(column)
|
10
|
+
unless /\A\w+(\.\w+)?\z/i.match?(column)
|
11
11
|
raise ActiveRecord::UnknownAttributeReference, "Query method called with non-attribute argument(s): #{column.inspect}. Use Arel.sql() for known-safe values."
|
12
12
|
end
|
13
13
|
end
|
@@ -18,7 +18,7 @@ module Hightop
|
|
18
18
|
def resolve_column(relation, column)
|
19
19
|
node = relation.send(:relation).send(:arel_columns, [column]).first
|
20
20
|
node = Arel::Nodes::SqlLiteral.new(node) if node.is_a?(String)
|
21
|
-
relation.
|
21
|
+
relation.connection_pool.with_connection { |c| c.visitor.accept(node, Arel::Collectors::SQLString.new).value }
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/hightop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hightop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: activesupport
|
@@ -16,15 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
18
|
+
version: '7.1'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
description:
|
25
|
+
version: '7.1'
|
28
26
|
email: andrew@ankane.org
|
29
27
|
executables: []
|
30
28
|
extensions: []
|
@@ -43,7 +41,6 @@ homepage: https://github.com/ankane/hightop
|
|
43
41
|
licenses:
|
44
42
|
- MIT
|
45
43
|
metadata: {}
|
46
|
-
post_install_message:
|
47
44
|
rdoc_options: []
|
48
45
|
require_paths:
|
49
46
|
- lib
|
@@ -51,15 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
48
|
requirements:
|
52
49
|
- - ">="
|
53
50
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3'
|
51
|
+
version: '3.2'
|
55
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
53
|
requirements:
|
57
54
|
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0'
|
60
57
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
62
|
-
signing_key:
|
58
|
+
rubygems_version: 3.6.7
|
63
59
|
specification_version: 4
|
64
60
|
summary: A nice shortcut for group count queries
|
65
61
|
test_files: []
|