pluck_all 2.3.2 → 2.3.3

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: 41bf75ef95bf276b2f1ab4777b6ca4d3c15c108fe82aab4283ff4010e3e96ceb
4
- data.tar.gz: de80e931f83c30605eeb69d1936acb97571987bde4f3cd716aa4ee6ce1ac628f
3
+ metadata.gz: 55464889dce014da2aee195d7351c56f8f44e542fe699f3b0a28bcfba066c00d
4
+ data.tar.gz: 711b8a9978198ead995bb24b1fa871f020ea703f5d1d1656e4aa6e5de25437a9
5
5
  SHA512:
6
- metadata.gz: 7f00d0bed7a562f0fb36f539fbf0b79b8263d01cb92a79b3eedce02761649f1ca74a7e717ca1a48d36e9a161dd1ea956ed2a10d44790c1cc35a4d07c06c8850a
7
- data.tar.gz: 96156e825c47d0e3901f43123390c5ee6d979508658725490f70af3493aa272bf5f8b4ff79260fd5a46234f3d8f1588e91fd8d00fc6a022ab6782b9895886bfd
6
+ metadata.gz: c1ccc08b4ebec79fbfb8627fcfe5310bd07330a2bbff600e31a285009ad72f496c81c34df5b6cba235da705ecb7f393ed39ae4daed8f110c0175ef45e933ffab
7
+ data.tar.gz: dd8fcb450688f6ee31ff7a9c53dfd4a1d79cb4fabaf50e36a02afea96d58234a922f77c14128563842a84e1620ced8926a1f83d366a9e1da9e5b90ddddf61dae
@@ -26,6 +26,7 @@ jobs:
26
26
  - 2.2
27
27
  - 2.6
28
28
  - 2.7
29
+ - 3.0
29
30
  gemfile:
30
31
  - active_record_32.gemfile
31
32
  - active_record_42.gemfile
@@ -36,22 +37,32 @@ jobs:
36
37
  - active_record_61.gemfile
37
38
  - mongoid_54.gemfile
38
39
  - mongoid_64.gemfile
39
- - mongoid_70.gemfile
40
+ - mongoid_73.gemfile
40
41
  exclude:
41
42
  - gemfile: active_record_32.gemfile
42
43
  ruby: 2.6
43
44
  - gemfile: active_record_32.gemfile
44
45
  ruby: 2.7
46
+ - gemfile: active_record_32.gemfile
47
+ ruby: 3.0
45
48
  - gemfile: active_record_32.gemfile
46
49
  orm: MONGOID
47
50
  - gemfile: active_record_42.gemfile
48
51
  ruby: 2.7
52
+ - gemfile: active_record_42.gemfile
53
+ ruby: 3.0
49
54
  - gemfile: active_record_42.gemfile
50
55
  orm: MONGOID
56
+ - gemfile: active_record_50.gemfile
57
+ ruby: 3.0
51
58
  - gemfile: active_record_50.gemfile
52
59
  orm: MONGOID
60
+ - gemfile: active_record_51.gemfile
61
+ ruby: 3.0
53
62
  - gemfile: active_record_51.gemfile
54
63
  orm: MONGOID
64
+ - gemfile: active_record_52.gemfile
65
+ ruby: 3.0
55
66
  - gemfile: active_record_52.gemfile
56
67
  orm: MONGOID
57
68
  - gemfile: active_record_60.gemfile
@@ -64,11 +75,15 @@ jobs:
64
75
  orm: MONGOID
65
76
  - gemfile: mongoid_54.gemfile
66
77
  ruby: 2.7
78
+ - gemfile: mongoid_54.gemfile
79
+ ruby: 3.0
80
+ - gemfile: mongoid_73.gemfile
81
+ ruby: 2.2
67
82
  - gemfile: mongoid_54.gemfile
68
83
  orm: ACTIVE_RECORD
69
84
  - gemfile: mongoid_64.gemfile
70
85
  orm: ACTIVE_RECORD
71
- - gemfile: mongoid_70.gemfile
86
+ - gemfile: mongoid_73.gemfile
72
87
  orm: ACTIVE_RECORD
73
88
  env:
74
89
  BUNDLE_GEMFILE: "gemfiles/${{ matrix.gemfile }}"
@@ -76,7 +91,7 @@ jobs:
76
91
 
77
92
  services:
78
93
  mongodb:
79
- image: mongo:3.4.23
94
+ image: mongo:3.6.23
80
95
  ports:
81
96
  - 27017:27017
82
97
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ 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
18
+ - Ruby 2.2 ~ 2.7, 3.0
19
19
  - Rails 3.2, 4.2, 5.0, 5.1, 5.2, 6.0, 6.1
20
20
 
21
21
  ## Installation
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in pluck_all.gemspec
4
4
 
5
- gem 'mongoid', '~> 7.0.0'
5
+ gem 'mongoid', '~> 7.3.3'
6
6
 
7
7
  group :test do
8
8
  gem 'simplecov', '< 0.18'
@@ -1,21 +1,39 @@
1
1
  # frozen_string_literal: true
2
2
  module Mongoid
3
3
  module Document::ClassMethods
4
- def pluck_array(*fields)
5
- where(nil).pluck_array(*fields)
6
- end
4
+ if defined?(Mongoid::Errors::CriteriaArgumentRequired)
5
+ def pluck_array(*fields)
6
+ where.pluck_array(*fields)
7
+ end
8
+
9
+ def pluck_all(*fields)
10
+ where.pluck_all(*fields)
11
+ end
12
+ else
13
+ def pluck_array(*fields)
14
+ where(nil).pluck_array(*fields)
15
+ end
7
16
 
8
- def pluck_all(*fields)
9
- where(nil).pluck_all(*fields)
17
+ def pluck_all(*fields)
18
+ where(nil).pluck_all(*fields)
19
+ end
10
20
  end
11
21
  end
12
22
 
13
23
  module Findable
14
- delegate :pluck_all, :pluck_array, to: :with_default_scope
24
+ if singleton_class < Forwardable
25
+ def_delegators :with_default_scope, :pluck_all, :pluck_array
26
+ else
27
+ delegate :pluck_all, :pluck_array, to: :with_default_scope
28
+ end
15
29
  end
16
30
 
17
31
  module Contextual
18
- delegate :pluck_all, :pluck_array, to: :context
32
+ if singleton_class < Forwardable
33
+ def_delegators :context, :pluck_all, :pluck_array
34
+ else
35
+ delegate :pluck_all, :pluck_array, to: :context
36
+ end
19
37
 
20
38
  class None
21
39
  def pluck_array(*)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module PluckAll
3
- VERSION = '2.3.2'
3
+ VERSION = '2.3.3'
4
4
  end
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.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - khiav reoy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-10 00:00:00.000000000 Z
11
+ date: 2022-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -115,7 +115,7 @@ files:
115
115
  - gemfiles/active_record_61.gemfile
116
116
  - gemfiles/mongoid_54.gemfile
117
117
  - gemfiles/mongoid_64.gemfile
118
- - gemfiles/mongoid_70.gemfile
118
+ - gemfiles/mongoid_73.gemfile
119
119
  - lib/pluck_all.rb
120
120
  - lib/pluck_all/hooks.rb
121
121
  - lib/pluck_all/models/active_record_extension.rb