active_median 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +1 -1
- data/lib/active_median/model.rb +3 -0
- data/lib/active_median/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0060d29bd7e382bb2cd06e63df45278b9dfe1c2cb9a2210bd3e82dd973fc90ef
|
4
|
+
data.tar.gz: 6d12c8ecf51e432fdcd659df62f81f629b29ea7476cc9e3719ce072ae86df7cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c5060c952f8c729c6463946db701c2ff6a503a2258252ab8b3b9efacd43b6719ad542d22cb488cf8d4d83f41222ce0d4bf5e0985f948cc1adfea9bf5a5467b
|
7
|
+
data.tar.gz: 3c2ec783cbe6a85e7e35814359e767dbb714b36be9578e46a0e5583dec5b74c19feb920192dcd2e2ace9e6482e296ccdc24659135a519d9413d79f53bed8b3de
|
data/CHANGELOG.md
CHANGED
data/LICENSE.txt
CHANGED
data/lib/active_median/model.rb
CHANGED
@@ -66,6 +66,9 @@ module ActiveMedian
|
|
66
66
|
raise "Connection adapter not supported: #{connection.adapter_name}"
|
67
67
|
end
|
68
68
|
|
69
|
+
# same as average
|
70
|
+
relation = relation.unscope(:order).distinct!(false) if relation.group_values.empty?
|
71
|
+
|
69
72
|
result = connection.select_all(relation.to_sql)
|
70
73
|
|
71
74
|
# typecast
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_median
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '0'
|
143
143
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
144
|
+
rubygems_version: 3.2.3
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Median and percentile for Active Record, Mongoid, arrays, and hashes
|