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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97636a27f16c0024056aa067afe5d54dcb01247be3236573db0d4a5365cf72ee
4
- data.tar.gz: 5c7dc9c490730959e05f4a633765ded663612f02543d62bb17ab05dfd1828f3e
3
+ metadata.gz: 0060d29bd7e382bb2cd06e63df45278b9dfe1c2cb9a2210bd3e82dd973fc90ef
4
+ data.tar.gz: 6d12c8ecf51e432fdcd659df62f81f629b29ea7476cc9e3719ce072ae86df7cd
5
5
  SHA512:
6
- metadata.gz: 48a5936c99b5325a8b7ac43035c7207912911a2e5ddd0889ccc6a4478d35360482cb2062f1756b5e0ba499e54ffff7e79e8adfe9fe29851a028d70194a497949
7
- data.tar.gz: abb786892e89b6361e7bf107d702ac4be5e9439f1a5364a7395c490c335c286bcdbcb6c106d130a6ef0870d3b2f100d6ded7c5c69db3ab87fbef4380dca8b9ca
6
+ metadata.gz: 56c5060c952f8c729c6463946db701c2ff6a503a2258252ab8b3b9efacd43b6719ad542d22cb488cf8d4d83f41222ce0d4bf5e0985f948cc1adfea9bf5a5467b
7
+ data.tar.gz: 3c2ec783cbe6a85e7e35814359e767dbb714b36be9578e46a0e5583dec5b74c19feb920192dcd2e2ace9e6482e296ccdc24659135a519d9413d79f53bed8b3de
@@ -1,3 +1,7 @@
1
+ ## 0.2.7 (2021-01-16)
2
+
3
+ - Fixed error with order
4
+
1
5
  ## 0.2.6 (2020-12-18)
2
6
 
3
7
  - Fixed error with certain column types for Active Record 6.1
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013-2020 Andrew Kane
1
+ Copyright (c) 2013-2021 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ActiveMedian
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
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.6
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: 2020-12-19 00:00:00.000000000 Z
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.1.4
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