multiverse 0.0.3 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 564a47885d1668334ca29f1c0d036f8cfe03e850
4
- data.tar.gz: 87575b3d26f533b2a53aebdeaa6138c499b75708
3
+ metadata.gz: 1a5b405124244211b42303192e0aeb223e64fe6f
4
+ data.tar.gz: dae706b36d5e653b9b3b3b150cbe715cb344ff55
5
5
  SHA512:
6
- metadata.gz: a94499ae8268d11fb6a833e564cfb73b165800a7bf7f4cfdcc095f105ed2543f68125a7f22221b548240dbbe65d89e6bdeb89b6cc224da12124f8bd163827ffa
7
- data.tar.gz: 1322982a75cd8f8c8e0bb0c0edbdf51361d47a40b7448ca95948021f5adfaf5cae6768a6525eee714bef755d23e04134700314152f17ab8ab6b335167db63d08
6
+ metadata.gz: 3043d8c0e5f12c3a8ef352b57dc46ba3bd686c3a5f4286957456c28005c07bd6d55827cb3c8010791740548f96971f5e6e069617ab36b9e5412ee8dadea61800
7
+ data.tar.gz: b8331d53ad7688b15a834d50a5fd0fcb7df408f4455f4386e5e2f549365cb0ab26d72ada5178bb2797392fe5a8c11b4a53dd6d7da707c06349c888ba053c63ac
@@ -1,3 +1,7 @@
1
+ ## 0.1.0
2
+
3
+ - Fixed test conf
4
+
1
5
  ## 0.0.3
2
6
 
3
7
  - Removed debug statement
data/README.md CHANGED
@@ -18,13 +18,15 @@ gem 'multiverse'
18
18
 
19
19
  ## Getting Started
20
20
 
21
- Generate a new database
21
+ In this example, we’ll have a separate database for our e-commerce catalog that we’ll call `catalog`.
22
+
23
+ The first step is to generate the necessary files.
22
24
 
23
25
  ```sh
24
26
  rails generate multiverse:db catalog
25
27
  ```
26
28
 
27
- This generates `CatalogRecord` class for models to inherit from and adds configuration to `config/database.yml`. It also creates a `db/catalog` directory for migrations and `schema.rb` to live.
29
+ This creates a `CatalogRecord` class for models to inherit from and adds configuration to `config/database.yml`. It also creates a `db/catalog` directory for migrations and `schema.rb` to live.
28
30
 
29
31
  `rails` and `rake` commands run for the original database by default. To run commands for the new database, use the `DB` environment variable. For instance:
30
32
 
@@ -93,6 +95,26 @@ And inside the `after_fork` block
93
95
  CatalogRecord.establish_connection :"catalog_#{Rails.env}"
94
96
  ```
95
97
 
98
+ ## Testing
99
+
100
+ ### Fixtures
101
+
102
+ [Rails fixtures](http://guides.rubyonrails.org/testing.html#the-low-down-on-fixtures) work automatically.
103
+
104
+ ### Database Cleaner
105
+
106
+ Database Cleaner supports multiple connections out of the box.
107
+
108
+ ```ruby
109
+ cleaner = DatabaseCleaner[:active_record, {model: CatalogRecord}]
110
+ cleaner.strategy = :transaction
111
+ cleaner.cleaning do
112
+ # code
113
+ end
114
+ ```
115
+
116
+ [Read more here](https://github.com/DatabaseCleaner/database_cleaner#how-to-use-with-multiple-orms)
117
+
96
118
  ## History
97
119
 
98
120
  View the [changelog](https://github.com/ankane/multiverse/blob/master/CHANGELOG.md)
@@ -19,7 +19,7 @@ module Multiverse
19
19
  production_conf = "database: db/#{lower_name}_production.sqlite3"
20
20
  else
21
21
  development_conf = "database: #{lower_name}_development"
22
- test_conf = "database: #{lower_name}_development"
22
+ test_conf = "database: #{lower_name}_test"
23
23
  production_conf = "url: <%= ENV['#{lower_name.upcase}_DATABASE_URL'] %>"
24
24
  end
25
25
 
@@ -1,3 +1,3 @@
1
1
  module Multiverse
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
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.0.3
4
+ version: 0.1.0
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-04 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails