active_record_distinct_on 0.1.7 → 1.3.0

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: f4f7e00e92e66dcb2c0da76a4ba7144df09c4ea34b7baff39571b67f52698aed
4
- data.tar.gz: e3687d2dbc72e6fb319a46dad87eeba582f8a5d18dd57ec4a168ec042a3ebe6b
3
+ metadata.gz: d2bdc5ffaa6c0bd2aed0a69fdab6a454a0ca1d5010907a91a3083c47f86e9f5f
4
+ data.tar.gz: 4a14067373b241a5f9c816d6dca59edfcb73410aa88929e3d6c6bfc7f94a0d20
5
5
  SHA512:
6
- metadata.gz: 6163b56dd345482bf65b419f80566f495d223e628e584748f74f92bcaf44714a8595c6e32df7f410e21faa1d525b43d9cb20085026680470e4ab5b7cce8287f8
7
- data.tar.gz: a07627fcc19dc63df247b3516d03ff04fb8d4e1e08347ed744cdd46353120d47126fbcbc792c2c4a291d03f4085c224752f608fd6477d96012ddc8c89d6c6b08
6
+ metadata.gz: beaca47b08017c4c728c9d1ddfe30f480e88c5ef12a8905b18e2e6d7791eaee3cd1fa64028ecf89831d57bfe121c45eae29ff398dbfba54ab835ef55ae0ed4dd
7
+ data.tar.gz: 3b43fad485e74d7c4e514475962e0280e5ee929a755ef74cc4bea013c5389ef7b6b1305ffdddd908058f7a92b635545a288d575af809bc74fd02bf481699f036
@@ -28,7 +28,13 @@ module ActiveRecordDistinctOn
28
28
 
29
29
  def distinct_on!(*fields)
30
30
  fields.flatten!
31
- fields.map! { |field| klass.attribute_alias?(field) ? klass.attribute_alias(field).to_sym : field }
31
+ fields.map! { |field|
32
+ if klass.attribute_alias?(field)
33
+ arel_table[klass.attribute_alias(field).to_sym]
34
+ else
35
+ arel_table[field]
36
+ end
37
+ }
32
38
  self.distinct_on_values += fields
33
39
  self
34
40
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveRecordDistinctOn
2
- VERSION = '0.1.7'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_distinct_on
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alec Larsen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-01 00:00:00.000000000 Z
11
+ date: 2022-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,48 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.1'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '4.2'
29
+ version: '5.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.1'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '1.17'
39
+ version: '0'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - "~>"
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '1.17'
46
+ version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rake
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '10.0'
53
+ version: 12.3.3
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - "~>"
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: '10.0'
60
+ version: 12.3.3
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: rspec
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ homepage: https://github.com/alecdotninja/active_record_distinct_on
147
147
  licenses:
148
148
  - MIT
149
149
  metadata: {}
150
- post_install_message:
150
+ post_install_message:
151
151
  rdoc_options: []
152
152
  require_paths:
153
153
  - lib
@@ -162,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.0.6
166
- signing_key:
165
+ rubygems_version: 3.1.6
166
+ signing_key:
167
167
  specification_version: 4
168
168
  summary: Adds support for `DISTINCT ON` statements when querying with ActiveRecord
169
169
  test_files: []