active_record_distinct_on 1.0.0 → 1.1.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: d89bb3cf6d39f950131b3f78428c788517cb966b113d7ef92f52772b5b7f5945
4
- data.tar.gz: 31d7bfa8e558ce78183138e1c1819224d05e6518c3c851ebea259661a5c43dc4
3
+ metadata.gz: '096152ff6a14c3419f6d8196a9b8fcfd6fb493ad77db7171f3294b475d461415'
4
+ data.tar.gz: 375f1085f3eb6d7e1077fc2a0745a5d225b181118662a88f54640fd34d55c054
5
5
  SHA512:
6
- metadata.gz: ea0e191a0e13b5fc324488ac879b1ec9442f877c6976000c667227ceb9db9428826d28a4ee91dc4a56b07f068a48f2e83054db2fcb3218e02d508d8fb4241cf4
7
- data.tar.gz: 81ecfaf1b1184dc0c242a5de795bd05b9a0458c9ca7937cf2ab9ac666abbcee55bfbbba67962101a8cf29a914ab87962278fdc2adb09b9ee52f9ddbae0a94ded
6
+ metadata.gz: cfda3ac9d31b0062ae5fba155eedd12a55e0e0be0b440029d4c387c6d579fb10a2c10c0f35eef235bce842eef65bfe423a7e471a9194bb1d14f49e0d8aa8c541
7
+ data.tar.gz: f68fdb758e4d9e17b72e1ba3797075d3b13f81af7c5af3c253cf127756bee8fe9093c491e9ce9a923339202f5647b4a33ab2d13f1fc6dcea4ef1f4e98293240d
@@ -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_attribute(klass.attribute_alias(field).to_sym)
34
+ else
35
+ arel_attribute(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 = '1.0.0'
2
+ VERSION = '1.1.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: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alec Larsen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2021-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -76,16 +76,16 @@ dependencies:
76
76
  name: simplecov
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: '0'
81
+ version: 0.18.1
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: '0'
88
+ version: 0.18.1
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: pry
91
91
  requirement: !ruby/object:Gem::Requirement