mongoid_monkey 0.2.2 → 0.2.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
  SHA1:
3
- metadata.gz: 1270657bcf2f5ccf0e861a86e0841a532195981c
4
- data.tar.gz: 644db84d29dd1212ed509e6a84398ed49665742c
3
+ metadata.gz: 3134be59a7b9be08b329ac420d3189cae51b91a8
4
+ data.tar.gz: 35ae853f92db846150ec9ad1e839e8b838835d8d
5
5
  SHA512:
6
- metadata.gz: eee46b50722dbff39018cb461d00ccaec280ac0a9e0d7de46d6121940849bb169e71853e21763054078a49314d2b016d4c7ab195727959a6c2ca5a2c9038c8f0
7
- data.tar.gz: e262c2697046add13c455ba4e2406904d874cbe334e8c8566d490f047ff563323acaa621ae6e312db3ff8403db5b7b176524a226973e9d0f1d65f9d8b477b9f8
6
+ metadata.gz: 6c87ede75b4c5dd2aacdf2686115c2941e4ba04ffb9833345a2dd67d3463206eacfb69a3e57c00dc2ba119d8c9f6fb406c027936e630586bdf6850a2f34b8e04
7
+ data.tar.gz: 09fd17ff52016d85d673683792c80b3b97ab5f3d06ff11f9f39a9ffa8c44b319576cb8303ec14252a994131e2214cb30fc61288257d5cedb75ed416cd9ba829b
data/README.md CHANGED
@@ -38,6 +38,7 @@ If you would only like some of the patches, please copy and paste the code to yo
38
38
  | `reorder.rb` | Backport `Criteria#reorder` method from Mongoid 4. | ● | ○ | ○ |
39
39
  | `only_pluck_localized.rb` | Backport [PR #4299](https://github.com/mongodb/mongoid/pull/4299) from Mongoid 6 which fixes `#only`, `#without`, and `#pluck` with localized fields. | ● | × | × |
40
40
  | `embedded_touch.rb` | Backport [Issue #3310](https://github.com/mongodb/mongoid/commit/a94c2f43573e58f973913c881ad9d11d62bf857c) from Mongoid 4 to add `:touch` option to `embedded_in`. | ● | ○ | ○ |
41
+ | `index_options.rb` | Backport latest index valid index options from Mongoid 6. | ● | ● | ○ |
41
42
 
42
43
  ### License
43
44
 
@@ -3,6 +3,7 @@ require 'version'
3
3
  require 'patches/atomic'
4
4
  require 'patches/big_decimal'
5
5
  require 'patches/db_commands'
6
+ require 'patches/index_options'
6
7
  require 'patches/instrument'
7
8
  require 'patches/reorder'
8
9
  require 'patches/only_pluck_localized'
@@ -0,0 +1,58 @@
1
+ # Backport Mongoid 6 index options to Mongoid 3 and 4.
2
+
3
+ if Mongoid::VERSION =~ /\A3\./
4
+
5
+ ::Mongoid::Indexes::Validators::Options.send(:remove_const, :VALID_OPTIONS)
6
+ module Mongoid::Indexes::Validators::Options
7
+ VALID_OPTIONS = [
8
+ :background,
9
+ :database,
10
+ :default_language,
11
+ :language_override,
12
+ :drop_dups,
13
+ :name,
14
+ :sparse,
15
+ :unique,
16
+ :max,
17
+ :min,
18
+ :bits,
19
+ :bucket_size,
20
+ :expire_after_seconds,
21
+ :weights,
22
+ :storage_engine,
23
+ :sphere_version,
24
+ :text_version,
25
+ :version,
26
+ :partial_filter_expression,
27
+ :collation
28
+ ]
29
+ end
30
+
31
+ elsif Mongoid::VERSION =~ /\A4\./
32
+
33
+ ::Mongoid::Indexable::Validators::Options.send(:remove_const, :VALID_OPTIONS)
34
+ module Mongoid::Indexable::Validators::Options
35
+ VALID_OPTIONS = [
36
+ :background,
37
+ :database,
38
+ :default_language,
39
+ :language_override,
40
+ :drop_dups,
41
+ :name,
42
+ :sparse,
43
+ :unique,
44
+ :max,
45
+ :min,
46
+ :bits,
47
+ :bucket_size,
48
+ :expire_after_seconds,
49
+ :weights,
50
+ :storage_engine,
51
+ :sphere_version,
52
+ :text_version,
53
+ :version,
54
+ :partial_filter_expression,
55
+ :collation
56
+ ]
57
+ end
58
+ end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MongoidMonkey
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -0,0 +1,31 @@
1
+ require "spec_helper"
2
+
3
+ if Mongoid::VERSION =~ /\A[34]\./
4
+
5
+ describe 'Index Valid Options' do
6
+ let(:mod){ Mongoid::VERSION =~ /\A3\./ ? Mongoid::Indexes::Validators : Mongoid::Indexable::Validators }
7
+ let(:exp) do
8
+ [ :background,
9
+ :database,
10
+ :default_language,
11
+ :language_override,
12
+ :drop_dups,
13
+ :name,
14
+ :sparse,
15
+ :unique,
16
+ :max,
17
+ :min,
18
+ :bits,
19
+ :bucket_size,
20
+ :expire_after_seconds,
21
+ :weights,
22
+ :storage_engine,
23
+ :sphere_version,
24
+ :text_version,
25
+ :version,
26
+ :partial_filter_expression,
27
+ :collation ]
28
+ end
29
+ it { expect(mod::Options::VALID_OPTIONS).to eq(exp) }
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_monkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnnyshields
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-13 00:00:00.000000000 Z
11
+ date: 2017-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -67,6 +67,7 @@ files:
67
67
  - lib/patches/big_decimal.rb
68
68
  - lib/patches/db_commands.rb
69
69
  - lib/patches/embedded_touch.rb
70
+ - lib/patches/index_options.rb
70
71
  - lib/patches/instrument.rb
71
72
  - lib/patches/only_pluck_localized.rb
72
73
  - lib/patches/reorder.rb
@@ -112,6 +113,7 @@ files:
112
113
  - spec/unit/db_commands/moped_database_spec.rb
113
114
  - spec/unit/db_commands/moped_indexes_spec.rb
114
115
  - spec/unit/embedded_touch_spec.rb
116
+ - spec/unit/index_options_spec.rb
115
117
  - spec/unit/instrument_spec.rb
116
118
  - spec/unit/only_pluck_localized_spec.rb
117
119
  - spec/unit/reorder_spec.rb
@@ -181,6 +183,7 @@ test_files:
181
183
  - spec/unit/db_commands/moped_database_spec.rb
182
184
  - spec/unit/db_commands/moped_indexes_spec.rb
183
185
  - spec/unit/embedded_touch_spec.rb
186
+ - spec/unit/index_options_spec.rb
184
187
  - spec/unit/instrument_spec.rb
185
188
  - spec/unit/only_pluck_localized_spec.rb
186
189
  - spec/unit/reorder_spec.rb