multiverse 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/multiverse.rb +8 -4
- data/lib/multiverse/railtie.rb +8 -0
- data/lib/multiverse/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f2d6e6b3dc37ba5f8eb59d778859d02fd14a49b
|
4
|
+
data.tar.gz: ee95ccdba100fd85db6e5fd80100198fac6dc09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ec011fbd04b4c5666b1d0eb1911f1738d6a69b5e9a7fd5b3281fe581e92435bc23240c8cc642ec2b49722a21d50895fd212074e4e268f75b9e5ecd35e91e2d8
|
7
|
+
data.tar.gz: cea5ba6f7890fdbba5f539a813cee1e9685e1bb6a33ece0fdf11afaf8510f39127bd6ef34309525d32d8dd0910f1065129ec9a0c80915ba89d3fc6be53cc0876
|
data/CHANGELOG.md
CHANGED
data/lib/multiverse.rb
CHANGED
@@ -8,7 +8,7 @@ module Multiverse
|
|
8
8
|
attr_writer :db
|
9
9
|
|
10
10
|
def db
|
11
|
-
@db ||= ENV["DB"]
|
11
|
+
@db ||= ENV["DB"].presence
|
12
12
|
end
|
13
13
|
|
14
14
|
def db_dir
|
@@ -22,9 +22,13 @@ module Multiverse
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def record_class
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
if db
|
26
|
+
record_class = parent_class_name.safe_constantize
|
27
|
+
abort "Missing model: #{parent_class_name}" unless record_class
|
28
|
+
record_class
|
29
|
+
else
|
30
|
+
ActiveRecord::Base
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def migrate_path
|
data/lib/multiverse/railtie.rb
CHANGED
@@ -39,6 +39,14 @@ module Multiverse
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
|
+
|
43
|
+
namespace :multiverse do
|
44
|
+
task :load_config do
|
45
|
+
ActiveRecord::Base.establish_connection(Multiverse.record_class.connection_config)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
Rake::Task["db:migrate:status"].enhance ["multiverse:load_config"]
|
42
50
|
end
|
43
51
|
end
|
44
52
|
end
|
data/lib/multiverse/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|