wherever-positions 0.4.2 → 0.4.3
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.
- data/VERSION +1 -1
- data/lib/wherever/wherever/mark.rb +11 -7
- data/wherever-positions.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
@@ -1,19 +1,23 @@
|
|
1
1
|
class Wherever
|
2
2
|
module Mark
|
3
3
|
def mark(name)
|
4
|
-
|
5
|
-
Mongoid::Config
|
6
|
-
else
|
7
|
-
Mongoid::Config.instance
|
8
|
-
end
|
9
|
-
configuration.master.eval("db.current_identifier.find().forEach( function(x){db.#{name}_identifier.insert(x)} )")
|
4
|
+
copy_collections("current_identifier", "#{name}_identifier")
|
10
5
|
config.key_groups.each do |keys|
|
11
6
|
[:identifier, :dataset].each do |db_type|
|
12
7
|
db_id = "#{keys.join('_')}_#{db_type}"
|
13
|
-
|
8
|
+
copy_collections("current_#{db_id}", "#{name}_#{db_id}")
|
14
9
|
end
|
15
10
|
end
|
16
11
|
set_price_lookup('price', nil, [{'marker' => name}])
|
17
12
|
end
|
13
|
+
|
14
|
+
def copy_collections(from_collection, to_collection)
|
15
|
+
copy_function = "db.#{from_collection}.find().forEach( function(x){db.#{to_collection}.insert(x)} )"
|
16
|
+
if Mongoid::Config.respond_to?(:instance)
|
17
|
+
Mongoid::Config.instance.master.eval(copy_function)
|
18
|
+
else
|
19
|
+
Mongoid::Config.master.eval(copy_function)
|
20
|
+
end
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
data/wherever-positions.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wherever-positions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 3
|
10
|
+
version: 0.4.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Henry
|