storey 2.1.1 → 2.1.2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/gemfiles/rails_5.0.gemfile.lock +2 -2
- data/gemfiles/rails_5.1.gemfile.lock +2 -2
- data/gemfiles/rails_5.2.gemfile.lock +2 -2
- data/lib/storey.rb +1 -0
- data/lib/storey/version.rb +1 -1
- data/spec/lib/storey_spec.rb +12 -0
- data/spec/spec_helper.rb +4 -6
- data/spec/storey/switch_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe9182b67b4f2738c91562f6366b59c15f7c5db272cdc32fd837ec1159cc753a
|
4
|
+
data.tar.gz: b61703b7b12878c85a3a9fbcf1cd0af5208c612f153ce8f25e8e7fe70aef6053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75fc2bdc24f43a52a7376fcd4db66484c0e53d01f06f6a65002d3a3eaa2f997867153d572dc1d032e2992979a76ba6d3d14e1234e8f3ec8fa65eeed040dd834a
|
7
|
+
data.tar.gz: 67d233bff3fdb58629cc15d5cc244182514e5810a23a5c5607a1b230714eb759425b113bbce776fe1eaaff5f0dd6c3b9fdcdc41d34d91524f945497324d494a3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [2.1.2] - 2018-08-14
|
6
|
+
### Fixed
|
7
|
+
- Instances when queries are cached between switches
|
8
|
+
|
5
9
|
## [2.1.1] - 2018-07-04
|
6
10
|
### Fixed
|
7
11
|
- Fix copying of schemas in when ActiveRecord caches queries
|
data/lib/storey.rb
CHANGED
data/lib/storey/version.rb
CHANGED
data/spec/lib/storey_spec.rb
CHANGED
@@ -25,6 +25,18 @@ RSpec.describe Storey do
|
|
25
25
|
|
26
26
|
Storey.switch("s1") { expect(Post.count).to eq 2 }
|
27
27
|
Storey.switch("s2") { expect(Post.count).to eq 3 }
|
28
|
+
|
29
|
+
Storey.switch("s1")
|
30
|
+
expect(Post.count).to eq 2
|
31
|
+
|
32
|
+
Storey.switch("s2")
|
33
|
+
expect(Post.count).to eq 3
|
34
|
+
|
35
|
+
Storey.create "foobar"
|
36
|
+
Storey.switch "foobar"
|
37
|
+
Storey.switch { Post.create }
|
38
|
+
expect(Post.count).to be_zero
|
39
|
+
Storey.switch { expect(Post.count).to eq 1 }
|
28
40
|
end
|
29
41
|
end
|
30
42
|
|
data/spec/spec_helper.rb
CHANGED
@@ -14,12 +14,6 @@ require 'pry'
|
|
14
14
|
RSpec.configure do |config|
|
15
15
|
config.order = 'random'
|
16
16
|
|
17
|
-
config.before(:suite) do
|
18
|
-
# Enable query cache so we can catch unexpected behaviour with AR
|
19
|
-
# caching
|
20
|
-
ActiveRecord::Base.connection.enable_query_cache!
|
21
|
-
end
|
22
|
-
|
23
17
|
config.before(:each) do
|
24
18
|
# We don't want configuration to leak into other tests
|
25
19
|
Storey.reload_config!
|
@@ -54,6 +48,10 @@ RSpec.configure do |config|
|
|
54
48
|
ENV['STEP'] = ENV['VERSION'] = nil
|
55
49
|
Rails.application.config.active_record.schema_format = :ruby
|
56
50
|
Storey::Migrator.migrate_all
|
51
|
+
|
52
|
+
# Enable query cache so we can catch unexpected behaviour with AR
|
53
|
+
# caching
|
54
|
+
ActiveRecord::Base.connection.enable_query_cache!
|
57
55
|
end
|
58
56
|
end
|
59
57
|
|
data/spec/storey/switch_spec.rb
CHANGED
@@ -82,8 +82,8 @@ describe Storey, "#switch" do
|
|
82
82
|
it "should execute the block in the default schema" do
|
83
83
|
Storey.switch "foobar"
|
84
84
|
Storey.switch { Post.create }
|
85
|
-
Post.count.
|
86
|
-
Storey.switch { Post.count.
|
85
|
+
expect(Post.count).to be_zero
|
86
|
+
Storey.switch { expect(Post.count).to eq 1 }
|
87
87
|
end
|
88
88
|
|
89
89
|
it "should return to the schema that the app was previously in" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|