pluck_all 2.3.3 → 2.3.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55464889dce014da2aee195d7351c56f8f44e542fe699f3b0a28bcfba066c00d
4
- data.tar.gz: 711b8a9978198ead995bb24b1fa871f020ea703f5d1d1656e4aa6e5de25437a9
3
+ metadata.gz: 9b1dc14b7a03d6ac387de2518fdb5cbdb0108514ee3315a601d54041d1a79dce
4
+ data.tar.gz: 276538553a9630c8454c91182cf66e0f96db77d8e76071100b7f04402c11db43
5
5
  SHA512:
6
- metadata.gz: c1ccc08b4ebec79fbfb8627fcfe5310bd07330a2bbff600e31a285009ad72f496c81c34df5b6cba235da705ecb7f393ed39ae4daed8f110c0175ef45e933ffab
7
- data.tar.gz: dd8fcb450688f6ee31ff7a9c53dfd4a1d79cb4fabaf50e36a02afea96d58234a922f77c14128563842a84e1620ced8926a1f83d366a9e1da9e5b90ddddf61dae
6
+ metadata.gz: a5417093197240c6c6768c8533ae5efac8a043301d4cb02504ab9bb3a06c1d1ee4a77ab9cde02af0c7da12256375f1c4426d99fb6f4c2e4c7c30c55fad412f0b
7
+ data.tar.gz: 741af484cc334b9e6cec7f9e07f9b399ef5d343bf3fcee51adc1f719479c7aa873d425bfcc816b5481769d77f182c5357386a05c9b888610f30c934530b61736
@@ -23,10 +23,11 @@ jobs:
23
23
  - ACTIVE_RECORD
24
24
  - MONGOID
25
25
  ruby:
26
- - 2.2
26
+ - 2.3
27
27
  - 2.6
28
28
  - 2.7
29
29
  - 3.0
30
+ - 3.1
30
31
  gemfile:
31
32
  - active_record_32.gemfile
32
33
  - active_record_42.gemfile
@@ -35,6 +36,7 @@ jobs:
35
36
  - active_record_52.gemfile
36
37
  - active_record_60.gemfile
37
38
  - active_record_61.gemfile
39
+ - active_record_70.gemfile
38
40
  - mongoid_54.gemfile
39
41
  - mongoid_64.gemfile
40
42
  - mongoid_73.gemfile
@@ -45,40 +47,56 @@ jobs:
45
47
  ruby: 2.7
46
48
  - gemfile: active_record_32.gemfile
47
49
  ruby: 3.0
50
+ - gemfile: active_record_32.gemfile
51
+ ruby: 3.1
48
52
  - gemfile: active_record_32.gemfile
49
53
  orm: MONGOID
50
54
  - gemfile: active_record_42.gemfile
51
55
  ruby: 2.7
52
56
  - gemfile: active_record_42.gemfile
53
57
  ruby: 3.0
58
+ - gemfile: active_record_42.gemfile
59
+ ruby: 3.1
54
60
  - gemfile: active_record_42.gemfile
55
61
  orm: MONGOID
56
62
  - gemfile: active_record_50.gemfile
57
63
  ruby: 3.0
64
+ - gemfile: active_record_50.gemfile
65
+ ruby: 3.1
58
66
  - gemfile: active_record_50.gemfile
59
67
  orm: MONGOID
60
68
  - gemfile: active_record_51.gemfile
61
69
  ruby: 3.0
70
+ - gemfile: active_record_51.gemfile
71
+ ruby: 3.1
62
72
  - gemfile: active_record_51.gemfile
63
73
  orm: MONGOID
64
74
  - gemfile: active_record_52.gemfile
65
75
  ruby: 3.0
76
+ - gemfile: active_record_52.gemfile
77
+ ruby: 3.1
66
78
  - gemfile: active_record_52.gemfile
67
79
  orm: MONGOID
68
80
  - gemfile: active_record_60.gemfile
69
- ruby: 2.2
81
+ ruby: 2.3
70
82
  - gemfile: active_record_60.gemfile
71
83
  orm: MONGOID
72
84
  - gemfile: active_record_61.gemfile
73
- ruby: 2.2
85
+ ruby: 2.3
74
86
  - gemfile: active_record_61.gemfile
75
87
  orm: MONGOID
88
+ - gemfile: active_record_70.gemfile
89
+ ruby: 2.3
90
+ - gemfile: active_record_70.gemfile
91
+ ruby: 2.6
92
+ - gemfile: active_record_70.gemfile
93
+ orm: MONGOID
76
94
  - gemfile: mongoid_54.gemfile
77
95
  ruby: 2.7
78
96
  - gemfile: mongoid_54.gemfile
79
97
  ruby: 3.0
80
- - gemfile: mongoid_73.gemfile
81
- ruby: 2.2
98
+ - gemfile: mongoid_54.gemfile
99
+ ruby: 3.1
82
100
  - gemfile: mongoid_54.gemfile
83
101
  orm: ACTIVE_RECORD
84
102
  - gemfile: mongoid_64.gemfile
data/CHANGELOG.md CHANGED
@@ -1,82 +1,93 @@
1
- ## Change Log
2
-
3
- ### [v2.3.1](https://github.com/khiav223577/pluck_all/compare/v2.3.0...v2.3.1) 2021/06/10
4
- - [#53](https://github.com/khiav223577/pluck_all/pull/53) Fix: ActiveRecord::ImmutableRelation (@khiav223577)
5
-
6
- ### [v2.3.0](https://github.com/khiav223577/pluck_all/compare/v2.2.1...v2.3.0) 2021/06/10
7
- - [#52](https://github.com/khiav223577/pluck_all/pull/52) Support `globalize` gem (@khiav223577)
8
- - [#51](https://github.com/khiav223577/pluck_all/pull/51) Fix: broken test cases caused by `mimemagic` (@khiav223577)
9
- - [#50](https://github.com/khiav223577/pluck_all/pull/50) Migrating from Travis CI to GitHub Actions (@khiav223577)
10
- - [#49](https://github.com/khiav223577/pluck_all/pull/49) Fix: test files should not be included in coverage (@khiav223577)
11
-
12
- ### [v2.2.1](https://github.com/khiav223577/pluck_all/compare/v2.1.0...v2.2.1) 2020/12/29
13
- - [#48](https://github.com/khiav223577/pluck_all/pull/48) fix Rails 6.1 `map!` deprecation warning (@klausbadelt)
14
-
15
- ### [v2.1.0](https://github.com/khiav223577/pluck_all/compare/v2.0.4...v2.1.0) 2020/10/19
16
- - [#47](https://github.com/khiav223577/pluck_all/pull/47) Use instantiate method to initialize model without calling callbacks (@khiav223577)
17
- - [#45](https://github.com/khiav223577/pluck_all/pull/45) Support Ruby 2.7 (@khiav223577)
18
- - [#44](https://github.com/khiav223577/pluck_all/pull/44) Move `require` from begin..rescue block for better debug message (@khiav223577)
19
- - [#43](https://github.com/khiav223577/pluck_all/pull/43) Use rails_compatibility to get attribute_types for better compatibility (@khiav223577)
20
- - [#41](https://github.com/khiav223577/pluck_all/pull/41) Support Rails 6.0 (@khiav223577)
21
-
22
- ### [v2.0.4](https://github.com/khiav223577/pluck_all/compare/v2.0.3...v2.0.4) 2019/04/04
23
- - [#40](https://github.com/khiav223577/pluck_all/pull/40) Fix: inconsistent with pluck when having `select` on relation (@khiav223577)
24
- - [#39](https://github.com/khiav223577/pluck_all/pull/39) Fix: undefined local variable or method `construct_relation_for_association_calculations` in Rails 5.2.2.1 (@MasashiYokota)
25
- - [#36](https://github.com/khiav223577/pluck_all/pull/36) Fix: broken test cases after bundler 2.0 was released (@khiav223577)
26
- - [#35](https://github.com/khiav223577/pluck_all/pull/35) refactor #test_pluck_with_includes (@khiav223577)
27
- - [#34](https://github.com/khiav223577/pluck_all/pull/34) Provide Arel support as well (@snkashis)
28
- - [#33](https://github.com/khiav223577/pluck_all/pull/33) Fix gemfile path in bin/setup (@snkashis)
29
- - [#32](https://github.com/khiav223577/pluck_all/pull/32) Move patches into separate files (@khiav223577)
30
-
31
- ### [v2.0.3](https://github.com/khiav223577/pluck_all/compare/v2.0.2...v2.0.3) 2018/07/19
32
- - [#30](https://github.com/khiav223577/pluck_all/pull/30) Fix: includes + pluck_all results in strange output (@khiav223577)
33
-
34
- ### [v2.0.2](https://github.com/khiav223577/pluck_all/compare/v2.0.1...v2.0.2) 2018/06/29
35
- - [#28](https://github.com/khiav223577/pluck_all/pull/28) Fix test cases and the result format may be wrong when plucking multiple columns with nil value may (@khiav223577)
36
- - [#27](https://github.com/khiav223577/pluck_all/pull/27) [Feature] Mongoid Hooks And Tests Separation (@berniechiu)
37
- - [#26](https://github.com/khiav223577/pluck_all/pull/26) [FIX] Wrong Module Skipped (@berniechiu)
38
-
39
- ### [v2.0.1](https://github.com/khiav223577/pluck_all/compare/v2.0.0...v2.0.1) 2018/05/27
40
- - [#25](https://github.com/khiav223577/pluck_all/pull/25) Fix that project without mongoid will raise LoadError (@khiav223577)
41
-
42
- ### [v2.0.0](https://github.com/khiav223577/pluck_all/compare/v1.2.4...v2.0.0) 2018/05/27
43
- - [#24](https://github.com/khiav223577/pluck_all/pull/24) Support Mongoid! (@khiav223577)
44
- - [#23](https://github.com/khiav223577/pluck_all/pull/23) Refactoring Coding Style (@khiav223577)
45
- - [#22](https://github.com/khiav223577/pluck_all/pull/22) test Rails 5.2 (@khiav223577)
46
- - [#21](https://github.com/khiav223577/pluck_all/pull/21) should test both 5.0.x and 5.1.x (@khiav223577)
47
- - [#20](https://github.com/khiav223577/pluck_all/pull/20) test pluck_all in rails 5.1.x (@khiav223577)
48
- - [#19](https://github.com/khiav223577/pluck_all/pull/19) add test cases to test `join` with table name and `alias` (@khiav223577)
49
-
50
- ### [v1.2.4](https://github.com/khiav223577/pluck_all/compare/v1.2.3...v1.2.4) 2017/04/11
51
- - [#17](https://github.com/khiav223577/pluck_all/pull/17) supports carrierwave 1.0.0 (@khiav223577)
52
-
53
- ### [v1.2.3](https://github.com/khiav223577/pluck_all/compare/v1.2.2...v1.2.3) 2017/04/03
54
- - [#14](https://github.com/khiav223577/pluck_all/pull/14) use mass assign to assign values (@khiav223577)
55
- - [#16](https://github.com/khiav223577/pluck_all/pull/16) Checking if Class has CarrierWave loaded (@basex)
56
- - [#15](https://github.com/khiav223577/pluck_all/pull/15) Restrict dependency to activerecord (@basex)
57
-
58
- ### [v1.2.2](https://github.com/khiav223577/pluck_all/compare/v1.2.1...v1.2.2) 2017/03/14
59
- - [#13](https://github.com/khiav223577/pluck_all/pull/13) Model.none.pluck_all(..) should return empty array instead of raising exception (@khiav223577)
60
- - [#12](https://github.com/khiav223577/pluck_all/pull/12) test other ruby version (@khiav223577)
61
-
62
- ### [v1.2.1](https://github.com/khiav223577/pluck_all/compare/v1.2.0...v1.2.1) 2017/01/24
63
- - [#11](https://github.com/khiav223577/pluck_all/pull/11) always return carrierwave uploader if possible (@khiav223577)
64
- - [#10](https://github.com/khiav223577/pluck_all/pull/10) change pluck_all return value of carrierwave column (@khiav223577)
65
-
66
- ### [v1.2.0](https://github.com/khiav223577/pluck_all/compare/v1.1.2...v1.2.0) 2017/01/24
67
- - [#5](https://github.com/khiav223577/pluck_all/pull/5) Support casting CarrierWave url (@khiav223577)
68
- - [#9](https://github.com/khiav223577/pluck_all/pull/9) need ActiveRecord version not Rails version (@khiav223577)
69
- - [#8](https://github.com/khiav223577/pluck_all/pull/8) Upgrade rake version in development (@khiav223577)
70
-
71
- ### [v1.1.2](https://github.com/khiav223577/pluck_all/compare/v1.1.1...v1.1.2) 2017/01/06
72
- - [#7](https://github.com/khiav223577/pluck_all/pull/7) fix pluck_all with join (@khiav223577)
73
-
74
- ### [v1.1.1](https://github.com/khiav223577/pluck_all/compare/v1.1.0...v1.1.1) 2017/01/01
75
- - [#4](https://github.com/khiav223577/pluck_all/pull/4) add code climate (@khiav223577)
76
-
77
- ### [v1.1.0](https://github.com/khiav223577/pluck_all/compare/v1.0.1...v1.1.0) 2016/12/21
78
- - [#3](https://github.com/khiav223577/pluck_all/pull/3) Feature/pluck array (@khiav223577)
79
-
80
- ### [v1.0.1](https://github.com/khiav223577/pluck_all/compare/v1.0.0...v1.0.1) 2016/12/20
81
- - [#2](https://github.com/khiav223577/pluck_all/pull/2) test with multiple rails version (@khiav223577)
82
- - [#1](https://github.com/khiav223577/pluck_all/pull/1) add basic test cases (@khiav223577)
1
+ ## Change Log
2
+
3
+ ### [upcoming](https://github.com/khiav223577/pluck_all/compare/v2.3.3...HEAD) 2022/07/27
4
+ - [#59](https://github.com/khiav223577/pluck_all/pull/59) Refactor: use gem to setup autoload paths in tests (@khiav223577)
5
+ - [#58](https://github.com/khiav223577/pluck_all/pull/58) Support Ruby 3.1 and Rails 7.0 (@khiav223577)
6
+
7
+ ### [v2.3.3](https://github.com/khiav223577/pluck_all/compare/v2.3.2...v2.3.3) 2022/01/12
8
+ - [#57](https://github.com/khiav223577/pluck_all/pull/57) Fix: delegate method error with mongoid 7.3.3 (@khiav223577)
9
+ - [#55](https://github.com/khiav223577/pluck_all/pull/55) Support Ruby 3.0 (@khiav223577)
10
+
11
+ ### [v2.3.2](https://github.com/khiav223577/pluck_all/compare/v2.3.1...v2.3.2) 2021/06/10
12
+ - [#54](https://github.com/khiav223577/pluck_all/pull/54) Fix: ActiveRecord::ImmutableRelation II (@khiav223577)
13
+
14
+ ### [v2.3.1](https://github.com/khiav223577/pluck_all/compare/v2.3.0...v2.3.1) 2021/06/10
15
+ - [#53](https://github.com/khiav223577/pluck_all/pull/53) Fix: ActiveRecord::ImmutableRelation (@khiav223577)
16
+
17
+ ### [v2.3.0](https://github.com/khiav223577/pluck_all/compare/v2.2.1...v2.3.0) 2021/06/10
18
+ - [#52](https://github.com/khiav223577/pluck_all/pull/52) Support `globalize` gem (@khiav223577)
19
+ - [#51](https://github.com/khiav223577/pluck_all/pull/51) Fix: broken test cases caused by `mimemagic` (@khiav223577)
20
+ - [#50](https://github.com/khiav223577/pluck_all/pull/50) Migrating from Travis CI to GitHub Actions (@khiav223577)
21
+ - [#49](https://github.com/khiav223577/pluck_all/pull/49) Fix: test files should not be included in coverage (@khiav223577)
22
+
23
+ ### [v2.2.1](https://github.com/khiav223577/pluck_all/compare/v2.1.0...v2.2.1) 2020/12/29
24
+ - [#48](https://github.com/khiav223577/pluck_all/pull/48) fix Rails 6.1 `map!` deprecation warning (@klausbadelt)
25
+
26
+ ### [v2.1.0](https://github.com/khiav223577/pluck_all/compare/v2.0.4...v2.1.0) 2020/10/19
27
+ - [#47](https://github.com/khiav223577/pluck_all/pull/47) Use instantiate method to initialize model without calling callbacks (@khiav223577)
28
+ - [#45](https://github.com/khiav223577/pluck_all/pull/45) Support Ruby 2.7 (@khiav223577)
29
+ - [#44](https://github.com/khiav223577/pluck_all/pull/44) Move `require` from begin..rescue block for better debug message (@khiav223577)
30
+ - [#43](https://github.com/khiav223577/pluck_all/pull/43) Use rails_compatibility to get attribute_types for better compatibility (@khiav223577)
31
+ - [#41](https://github.com/khiav223577/pluck_all/pull/41) Support Rails 6.0 (@khiav223577)
32
+
33
+ ### [v2.0.4](https://github.com/khiav223577/pluck_all/compare/v2.0.3...v2.0.4) 2019/04/04
34
+ - [#40](https://github.com/khiav223577/pluck_all/pull/40) Fix: inconsistent with pluck when having `select` on relation (@khiav223577)
35
+ - [#39](https://github.com/khiav223577/pluck_all/pull/39) Fix: undefined local variable or method `construct_relation_for_association_calculations` in Rails 5.2.2.1 (@MasashiYokota)
36
+ - [#36](https://github.com/khiav223577/pluck_all/pull/36) Fix: broken test cases after bundler 2.0 was released (@khiav223577)
37
+ - [#35](https://github.com/khiav223577/pluck_all/pull/35) refactor #test_pluck_with_includes (@khiav223577)
38
+ - [#34](https://github.com/khiav223577/pluck_all/pull/34) Provide Arel support as well (@snkashis)
39
+ - [#33](https://github.com/khiav223577/pluck_all/pull/33) Fix gemfile path in bin/setup (@snkashis)
40
+ - [#32](https://github.com/khiav223577/pluck_all/pull/32) Move patches into separate files (@khiav223577)
41
+
42
+ ### [v2.0.3](https://github.com/khiav223577/pluck_all/compare/v2.0.2...v2.0.3) 2018/07/19
43
+ - [#30](https://github.com/khiav223577/pluck_all/pull/30) Fix: includes + pluck_all results in strange output (@khiav223577)
44
+
45
+ ### [v2.0.2](https://github.com/khiav223577/pluck_all/compare/v2.0.1...v2.0.2) 2018/06/29
46
+ - [#28](https://github.com/khiav223577/pluck_all/pull/28) Fix test cases and the result format may be wrong when plucking multiple columns with nil value may (@khiav223577)
47
+ - [#27](https://github.com/khiav223577/pluck_all/pull/27) [Feature] Mongoid Hooks And Tests Separation (@berniechiu)
48
+ - [#26](https://github.com/khiav223577/pluck_all/pull/26) [FIX] Wrong Module Skipped (@berniechiu)
49
+
50
+ ### [v2.0.1](https://github.com/khiav223577/pluck_all/compare/v2.0.0...v2.0.1) 2018/05/27
51
+ - [#25](https://github.com/khiav223577/pluck_all/pull/25) Fix that project without mongoid will raise LoadError (@khiav223577)
52
+
53
+ ### [v2.0.0](https://github.com/khiav223577/pluck_all/compare/v1.2.4...v2.0.0) 2018/05/27
54
+ - [#24](https://github.com/khiav223577/pluck_all/pull/24) Support Mongoid! (@khiav223577)
55
+ - [#23](https://github.com/khiav223577/pluck_all/pull/23) Refactoring Coding Style (@khiav223577)
56
+ - [#22](https://github.com/khiav223577/pluck_all/pull/22) test Rails 5.2 (@khiav223577)
57
+ - [#21](https://github.com/khiav223577/pluck_all/pull/21) should test both 5.0.x and 5.1.x (@khiav223577)
58
+ - [#20](https://github.com/khiav223577/pluck_all/pull/20) test pluck_all in rails 5.1.x (@khiav223577)
59
+ - [#19](https://github.com/khiav223577/pluck_all/pull/19) add test cases to test `join` with table name and `alias` (@khiav223577)
60
+
61
+ ### [v1.2.4](https://github.com/khiav223577/pluck_all/compare/v1.2.3...v1.2.4) 2017/04/11
62
+ - [#17](https://github.com/khiav223577/pluck_all/pull/17) supports carrierwave 1.0.0 (@khiav223577)
63
+
64
+ ### [v1.2.3](https://github.com/khiav223577/pluck_all/compare/v1.2.2...v1.2.3) 2017/04/03
65
+ - [#14](https://github.com/khiav223577/pluck_all/pull/14) use mass assign to assign values (@khiav223577)
66
+ - [#16](https://github.com/khiav223577/pluck_all/pull/16) Checking if Class has CarrierWave loaded (@basex)
67
+ - [#15](https://github.com/khiav223577/pluck_all/pull/15) Restrict dependency to activerecord (@basex)
68
+
69
+ ### [v1.2.2](https://github.com/khiav223577/pluck_all/compare/v1.2.1...v1.2.2) 2017/03/14
70
+ - [#13](https://github.com/khiav223577/pluck_all/pull/13) Model.none.pluck_all(..) should return empty array instead of raising exception (@khiav223577)
71
+ - [#12](https://github.com/khiav223577/pluck_all/pull/12) test other ruby version (@khiav223577)
72
+
73
+ ### [v1.2.1](https://github.com/khiav223577/pluck_all/compare/v1.2.0...v1.2.1) 2017/01/24
74
+ - [#11](https://github.com/khiav223577/pluck_all/pull/11) always return carrierwave uploader if possible (@khiav223577)
75
+ - [#10](https://github.com/khiav223577/pluck_all/pull/10) change pluck_all return value of carrierwave column (@khiav223577)
76
+
77
+ ### [v1.2.0](https://github.com/khiav223577/pluck_all/compare/v1.1.2...v1.2.0) 2017/01/24
78
+ - [#5](https://github.com/khiav223577/pluck_all/pull/5) Support casting CarrierWave url (@khiav223577)
79
+ - [#9](https://github.com/khiav223577/pluck_all/pull/9) need ActiveRecord version not Rails version (@khiav223577)
80
+ - [#8](https://github.com/khiav223577/pluck_all/pull/8) Upgrade rake version in development (@khiav223577)
81
+
82
+ ### [v1.1.2](https://github.com/khiav223577/pluck_all/compare/v1.1.1...v1.1.2) 2017/01/06
83
+ - [#7](https://github.com/khiav223577/pluck_all/pull/7) fix pluck_all with join (@khiav223577)
84
+
85
+ ### [v1.1.1](https://github.com/khiav223577/pluck_all/compare/v1.1.0...v1.1.1) 2017/01/01
86
+ - [#4](https://github.com/khiav223577/pluck_all/pull/4) add code climate (@khiav223577)
87
+
88
+ ### [v1.1.0](https://github.com/khiav223577/pluck_all/compare/v1.0.1...v1.1.0) 2016/12/21
89
+ - [#3](https://github.com/khiav223577/pluck_all/pull/3) Feature/pluck array (@khiav223577)
90
+
91
+ ### [v1.0.1](https://github.com/khiav223577/pluck_all/compare/v1.0.0...v1.0.1) 2016/12/20
92
+ - [#2](https://github.com/khiav223577/pluck_all/pull/2) test with multiple rails version (@khiav223577)
93
+ - [#1](https://github.com/khiav223577/pluck_all/pull/1) add basic test cases (@khiav223577)
data/README.md CHANGED
@@ -15,8 +15,8 @@ If you have a Rails 3 project, and want to pluck not only one column,
15
15
  feel free to use this gem and no need to worry about upgrading to Rails 4, 5, 6 in the future will break this.
16
16
 
17
17
  ## Supports
18
- - Ruby 2.2 ~ 2.7, 3.0
19
- - Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1
18
+ - Ruby 2.3 ~ 2.7, 3.0 ~ 3.1
19
+ - Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1, 7.0
20
20
 
21
21
  ## Installation
22
22
 
@@ -0,0 +1,19 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pluck_all.gemspec
4
+
5
+ gem 'sqlite3', '~> 1.4.1'
6
+ gem 'zeitwerk'
7
+ gem 'activerecord', '~> 7.0.6'
8
+ gem 'rails_compatibility', '~> 0.0.7'
9
+
10
+ gem 'carrierwave', '~> 0.11.0'
11
+ gem 'mimemagic', '< 0.4.3' # Used by carrierwave gem
12
+
13
+ # gem 'globalize', '~> 6.0.1' # TODO: wait for globalize to support Rails 7.
14
+
15
+ group :test do
16
+ gem 'simplecov', '< 0.18'
17
+ end
18
+
19
+ gemspec path: '../'
@@ -4,6 +4,11 @@ source 'https://rubygems.org'
4
4
 
5
5
  gem 'mongoid', '~> 7.3.3'
6
6
 
7
+ # We need zeitwerk for autoloading in Rails 7
8
+ # But zeitwerk required ruby >= 2.4.4, we cannot test it in ruby 2.3
9
+ # So we lock the version below 7
10
+ gem 'activesupport', '< 7'
11
+
7
12
  group :test do
8
13
  gem 'simplecov', '< 0.18'
9
14
  end
@@ -1,7 +1,6 @@
1
- require 'rails_compatibility/attribute_types'
2
1
  require 'rails_compatibility/has_include'
3
2
  require 'rails_compatibility/apply_join_dependency'
4
- require_relative 'patches/deserialize'
3
+ require 'rails_compatibility/cast_values'
5
4
 
6
5
  class ActiveRecord::Relation
7
6
  def cast_need_columns(column_names, _klass = nil)
@@ -28,14 +27,10 @@ class ActiveRecord::Relation
28
27
  if Gem::Version.new(ActiveRecord::VERSION::STRING) < Gem::Version.new('4.0.0')
29
28
  def pluck_all(*column_names, cast_uploader_url: true)
30
29
  result = select_all(column_names)
31
- result.map! do |attributes| # This map! behaves different to array#map!
32
- initialized_attributes = klass.initialize_attributes(attributes)
33
- attributes.each do |key, _attribute|
34
- attributes[key] = klass.type_cast_attribute(key, initialized_attributes) # TODO: 現在AS過後的type cast會有一點問題
35
- end
36
- cast_carrier_wave_uploader_url(attributes) if cast_uploader_url
37
- next attributes
38
- end
30
+ casted_result = RailsCompatibility.cast_values(klass, result)
31
+
32
+ casted_result.each{|attributes| cast_carrier_wave_uploader_url(attributes) } if cast_uploader_url
33
+ return casted_result
39
34
  end
40
35
 
41
36
  private
@@ -57,14 +52,10 @@ class ActiveRecord::Relation
57
52
  return RailsCompatibility.apply_join_dependency(self).pluck_all(*column_names) if has_include
58
53
 
59
54
  result = select_all(column_names)
60
- attribute_types = RailsCompatibility.attribute_types(klass)
61
- result.map do |attributes| # This map behaves different to array#map
62
- attributes.each do |key, attribute|
63
- attributes[key] = result.send(:column_type, key, attribute_types).deserialize(attribute) # TODO: 現在AS過後的type cast會有一點問題,但似乎原生的pluck也有此問題
64
- end
65
- cast_carrier_wave_uploader_url(attributes) if cast_uploader_url
66
- next attributes
67
- end
55
+ casted_result = RailsCompatibility.cast_values(klass, result)
56
+
57
+ casted_result.each{|attributes| cast_carrier_wave_uploader_url(attributes) } if cast_uploader_url
58
+ return casted_result
68
59
  end
69
60
 
70
61
  private
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module PluckAll
3
- VERSION = '2.3.3'
3
+ VERSION = '2.3.4'
4
4
  end
data/pluck_all.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  }
36
36
 
37
37
  spec.add_dependency 'activesupport', '>= 3.0.0'
38
- spec.add_dependency 'rails_compatibility', '>= 0.0.7'
38
+ spec.add_dependency 'rails_compatibility', '>= 0.0.10'
39
39
 
40
40
  spec.add_development_dependency 'bundler', '>= 1.17', '< 3.x'
41
41
  spec.add_development_dependency 'rake', '~> 12.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pluck_all
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.3
4
+ version: 2.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-12 00:00:00.000000000 Z
11
+ date: 2023-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.7
33
+ version: 0.0.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.7
40
+ version: 0.0.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +113,7 @@ files:
113
113
  - gemfiles/active_record_52.gemfile
114
114
  - gemfiles/active_record_60.gemfile
115
115
  - gemfiles/active_record_61.gemfile
116
+ - gemfiles/active_record_70.gemfile
116
117
  - gemfiles/mongoid_54.gemfile
117
118
  - gemfiles/mongoid_64.gemfile
118
119
  - gemfiles/mongoid_73.gemfile
@@ -120,7 +121,6 @@ files:
120
121
  - lib/pluck_all/hooks.rb
121
122
  - lib/pluck_all/models/active_record_extension.rb
122
123
  - lib/pluck_all/models/mongoid_extension.rb
123
- - lib/pluck_all/models/patches/deserialize.rb
124
124
  - lib/pluck_all/version.rb
125
125
  - pluck_all.gemspec
126
126
  homepage: https://github.com/khiav223577/pluck_all
@@ -1,13 +0,0 @@
1
- module ActiveRecord
2
- [
3
- *([Type::Value, Type::Integer, Type::Serialized] if defined?(Type::Value)),
4
- *([Enum::EnumType] if defined?(Enum::EnumType)),
5
- ].each do |s|
6
- s.class_eval do
7
- if !method_defined?(:deserialize) && method_defined?(:type_cast_from_database)
8
- # deserialize was changed to type_cast_from_database in Rails 5
9
- alias_method :deserialize, :type_cast_from_database
10
- end
11
- end
12
- end
13
- end