mongoid-collection-separated 0.1.2 → 0.1.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: bfba70a37de67de41dc7d5d0adf80a2a2b3d5bc8e2c33ad8aa69b135e9b6f5f3
4
- data.tar.gz: a44ba06116ad965932694728814144307946de2e3defe2718d4266cce185e3b4
3
+ metadata.gz: 7b0dfbf177db8b81faeb6a4d9f2ae080eb373d147636b003667ef5e8e58e2e86
4
+ data.tar.gz: c95fa5dc1af5a6c6999e93bebc3e5438ee477433dd61c0861b7b27bca53c69d1
5
5
  SHA512:
6
- metadata.gz: cba3d857433998e06971c0493c0708986509ad5afd63ecb78c6c68347eef00537052f44fbbea291fe8b3b8aa9c7b9469f9cc1d9fd370b45e0b36e4508b9bba6c
7
- data.tar.gz: '048c3cf68d0e75226afc477b70fbb9acf42ce2cd419e263c97201ac7fec5b498ab4a27b27e39907c7263a1a25dc536d2f1dfab53347ed667dcd9b1523f04cedd'
6
+ metadata.gz: '0902c52179e2f075acb69c7a2f87200ea765024050d9ecd8326d49da82a5497fcf64ffbffe552c04cb833b88ca7bf66b351ce07d438d0f8baceb4b933912399f'
7
+ data.tar.gz: c172cf884b0ac8199a4c9a6ff2d8a7406b92d4c0f584d332e408516b65336ae4d26913f322be0dfcd2306c41a1356f72b77c4287e11b1430f4f50c03ba82eac7
@@ -6,8 +6,8 @@ module Mongoid
6
6
  # 1. Get form_id from selector
7
7
  # 2. If collection is entries, not matter from context or current collection object, and form has entries_separated flag set, set collection name instance variable to entries plus form_id as new collection name
8
8
 
9
- def create_context_with_separated_entries
10
- context = create_context_without_separated_entries
9
+ def create_context_with_separated
10
+ context = create_context_without_separated
11
11
  query_class = instance_variable_get :@klass
12
12
  new_collection_name = calc_new_collection_name query_class
13
13
  unless new_collection_name.blank?
@@ -38,8 +38,8 @@ module Mongoid
38
38
  selector[query_class.separated_field.to_s]
39
39
  end
40
40
 
41
- alias_method :create_context_without_separated_entries, :create_context
42
- alias_method :create_context, :create_context_with_separated_entries
41
+ alias_method :create_context_without_separated, :create_context
42
+ alias_method :create_context, :create_context_with_separated
43
43
  end
44
44
  end
45
45
 
@@ -53,8 +53,8 @@ module Mongoid
53
53
  # 1. 'base' should be an instance of Form
54
54
  # 2. If form has entries_separated flat and collection name is entries, clone a new context because it is build each time when called and set to context. Then remove form_id from selector because all the entries inside the new collection has the same form_id
55
55
 
56
- def criteria_with_separated_entries
57
- cri = criteria_without_separated_entries
56
+ def criteria_with_separated
57
+ cri = criteria_without_separated
58
58
  query_class = cri.instance_variable_get :@klass
59
59
  if should_query_from_separated_collection? query_class
60
60
  context = cri.context.clone
@@ -83,8 +83,8 @@ module Mongoid
83
83
  query_class.send(query_class.calc_collection_name_fun, base.send(query_class.separated_parent_field))
84
84
  end
85
85
 
86
- alias_method :criteria_without_separated_entries, :criteria
87
- alias_method :criteria, :criteria_with_separated_entries
86
+ alias_method :criteria_without_separated, :criteria
87
+ alias_method :criteria, :criteria_with_separated
88
88
  end
89
89
  end
90
90
  end
@@ -1,6 +1,6 @@
1
1
  module Mongoid
2
2
  module CollectionSeparated
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-collection-separated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - aibotyu
@@ -120,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubyforge_project:
124
- rubygems_version: 2.7.8
123
+ rubygems_version: 3.0.1
125
124
  signing_key:
126
125
  specification_version: 4
127
126
  summary: Save the mongoid model into different collections by condition