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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a5b405124244211b42303192e0aeb223e64fe6f
4
- data.tar.gz: dae706b36d5e653b9b3b3b150cbe715cb344ff55
3
+ metadata.gz: 3f2d6e6b3dc37ba5f8eb59d778859d02fd14a49b
4
+ data.tar.gz: ee95ccdba100fd85db6e5fd80100198fac6dc09f
5
5
  SHA512:
6
- metadata.gz: 3043d8c0e5f12c3a8ef352b57dc46ba3bd686c3a5f4286957456c28005c07bd6d55827cb3c8010791740548f96971f5e6e069617ab36b9e5412ee8dadea61800
7
- data.tar.gz: b8331d53ad7688b15a834d50a5fd0fcb7df408f4455f4386e5e2f549365cb0ab26d72ada5178bb2797392fe5a8c11b4a53dd6d7da707c06349c888ba053c63ac
6
+ metadata.gz: 4ec011fbd04b4c5666b1d0eb1911f1738d6a69b5e9a7fd5b3281fe581e92435bc23240c8cc642ec2b49722a21d50895fd212074e4e268f75b9e5ecd35e91e2d8
7
+ data.tar.gz: cea5ba6f7890fdbba5f539a813cee1e9685e1bb6a33ece0fdf11afaf8510f39127bd6ef34309525d32d8dd0910f1065129ec9a0c80915ba89d3fc6be53cc0876
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.1.1
2
+
3
+ - Fixed `db:migrate:status` when DB specified
4
+ - Better consistency with default behavior when no DB specified
5
+
1
6
  ## 0.1.0
2
7
 
3
8
  - Fixed test conf
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
- record_class = parent_class_name.safe_constantize
26
- abort "Missing model: #{parent_class_name}" unless record_class
27
- record_class
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Multiverse
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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: 2017-11-13 00:00:00.000000000 Z
11
+ date: 2018-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails