once-ler 0.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onceler.rb +7 -0
- data/lib/onceler/extensions/active_record.rb +16 -4
- data/lib/onceler/transactions.rb +1 -1
- data/lib/onceler/transactions/{active_record_4.rb → active_record.rb} +1 -2
- metadata +35 -17
- data/lib/onceler/extensions/active_record_4_0.rb +0 -19
- data/lib/onceler/extensions/active_record_4_1.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 494ac049dd247bc5578276f65940cc08171bf71002937bfe3c8f14514433bdc5
|
4
|
+
data.tar.gz: 701e2e2d48d4243ea0d6ddc43f94f870d9ae36b8ec61330f17e45e8e47b0cdf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa2391255b52c952b8fe9976310f937b2bf79a3e69836b2d10948faadee764ca9e92efa5d42aa14a31eee5b9b0a83cf7ee1c340caad79846f20cd321c937447
|
7
|
+
data.tar.gz: 6758091868cddcb4bf47d1e8122440e11ece9b58cb022e586dc142f9bcd629a4354645f71d102d9247c83dba27b22dce4abbc1b18ce37ac9f4d6af50a363c5c1
|
data/lib/onceler.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
require "rspec"
|
2
|
+
require "rubygems"
|
3
|
+
|
2
4
|
require "onceler/basic_helpers"
|
3
5
|
require "onceler/configuration"
|
4
6
|
require "onceler/extensions/active_record"
|
7
|
+
|
5
8
|
if defined?(DatabaseCleaner)
|
9
|
+
unless !DatabaseCleaner.const_defined?("VERSION") ||
|
10
|
+
Gem::Requirement.new(">= 1.7").satisfied_by?(Gem::Version.new(DatabaseCleaner::VERSION))
|
11
|
+
raise "Onceler in only compatible with DatabaseCleaner >= 1.7."
|
12
|
+
end
|
6
13
|
require "onceler/extensions/database_cleaner"
|
7
14
|
end
|
@@ -1,7 +1,19 @@
|
|
1
1
|
require "active_record"
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
# monkey-patch this to not clear connections so that we don't lose our
|
4
|
+
# transactions
|
5
|
+
|
6
|
+
module ActiveRecord::TestFixtures
|
7
|
+
def teardown_fixtures
|
8
|
+
# Rollback changes if a transaction is active.
|
9
|
+
if run_in_transaction?
|
10
|
+
@fixture_connections.each do |connection|
|
11
|
+
connection.rollback_transaction if connection.transaction_open?
|
12
|
+
end
|
13
|
+
@fixture_connections.clear
|
14
|
+
else
|
15
|
+
ActiveRecord::FixtureSet.reset_cache
|
16
|
+
end
|
17
|
+
### ONCELER'd
|
18
|
+
end
|
7
19
|
end
|
data/lib/onceler/transactions.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "active_record"
|
2
|
-
require "onceler/transactions/
|
2
|
+
require "onceler/transactions/active_record"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Onceler
|
2
2
|
module Transactions
|
3
3
|
def begin_transaction(conn)
|
4
|
-
conn.begin_transaction
|
4
|
+
conn.begin_transaction joinable: false
|
5
5
|
end
|
6
6
|
|
7
7
|
def rollback_transaction(conn)
|
@@ -9,4 +9,3 @@ module Onceler
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: once-ler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Jensen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,28 +16,48 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '5.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '6.2'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
29
|
+
version: '5.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '6.2'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rspec
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '3.
|
39
|
+
version: '3.6'
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
44
|
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '3.
|
46
|
+
version: '3.6'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: appraisal
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.3.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: 2.3.0
|
41
61
|
- !ruby/object:Gem::Dependency
|
42
62
|
name: byebug
|
43
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,17 +86,16 @@ files:
|
|
66
86
|
- lib/onceler/basic_helpers.rb
|
67
87
|
- lib/onceler/configuration.rb
|
68
88
|
- lib/onceler/extensions/active_record.rb
|
69
|
-
- lib/onceler/extensions/active_record_4_0.rb
|
70
|
-
- lib/onceler/extensions/active_record_4_1.rb
|
71
89
|
- lib/onceler/extensions/database_cleaner.rb
|
72
90
|
- lib/onceler/recordable.rb
|
73
91
|
- lib/onceler/recorder.rb
|
74
92
|
- lib/onceler/transactions.rb
|
75
|
-
- lib/onceler/transactions/
|
93
|
+
- lib/onceler/transactions/active_record.rb
|
76
94
|
homepage: http://github.com/instructure/once-ler
|
77
|
-
licenses:
|
95
|
+
licenses:
|
96
|
+
- MIT
|
78
97
|
metadata: {}
|
79
|
-
post_install_message:
|
98
|
+
post_install_message:
|
80
99
|
rdoc_options: []
|
81
100
|
require_paths:
|
82
101
|
- lib
|
@@ -84,16 +103,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
84
103
|
requirements:
|
85
104
|
- - ">="
|
86
105
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
106
|
+
version: '2.6'
|
88
107
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
108
|
requirements:
|
90
109
|
- - ">="
|
91
110
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
111
|
+
version: 2.6.0
|
93
112
|
requirements: []
|
94
|
-
|
95
|
-
|
96
|
-
signing_key:
|
113
|
+
rubygems_version: 3.2.15
|
114
|
+
signing_key:
|
97
115
|
specification_version: 4
|
98
116
|
summary: rspec supercharger
|
99
117
|
test_files: []
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# monkey-patch this to not clear connections so that we don't lose our
|
2
|
-
# transactions
|
3
|
-
|
4
|
-
module ActiveRecord::TestFixtures
|
5
|
-
def teardown_fixtures
|
6
|
-
return if ActiveRecord::Base.configurations.blank?
|
7
|
-
|
8
|
-
# Rollback changes if a transaction is active.
|
9
|
-
if run_in_transaction?
|
10
|
-
@fixture_connections.each do |connection|
|
11
|
-
connection.rollback_transaction if connection.transaction_open?
|
12
|
-
end
|
13
|
-
@fixture_connections.clear
|
14
|
-
else
|
15
|
-
ActiveRecord::FixtureSet.reset_cache
|
16
|
-
end
|
17
|
-
### ONCELER'd
|
18
|
-
end
|
19
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# monkey-patch this to not clear connections so that we don't lose our
|
2
|
-
# transactions
|
3
|
-
|
4
|
-
module ActiveRecord::TestFixtures
|
5
|
-
def teardown_fixtures
|
6
|
-
# Rollback changes if a transaction is active.
|
7
|
-
if run_in_transaction?
|
8
|
-
@fixture_connections.each do |connection|
|
9
|
-
connection.rollback_transaction if connection.transaction_open?
|
10
|
-
end
|
11
|
-
@fixture_connections.clear
|
12
|
-
else
|
13
|
-
ActiveRecord::FixtureSet.reset_cache
|
14
|
-
end
|
15
|
-
### ONCELER'd
|
16
|
-
end
|
17
|
-
end
|