fishplate 0.4.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fishplate/version.rb +1 -1
- data/lib/fishplate.rb +16 -6
- metadata +2 -5
- data/fishplate/.gitignore +0 -11
- data/fishplate/.rspec +0 -3
- data/fishplate/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '049c9d10e45521ee6cb916304349d07c904152430d9300a5531e8a0a22e87f48'
|
4
|
+
data.tar.gz: '09e8808d1c9c7ed3d2a67dbdc5f44cfacd3850847ab072efbb15147997ec6c25'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41fbf7a6cb46f3f5b4bef5abe884a8e01e3d945cd241552a2a6a8d75ed7b36628e8f36ddbc71513e51803a70a16b78e72124736b0d8b987e50548722ce751e7a
|
7
|
+
data.tar.gz: a977ad739f3d28217d9e693f7b520eebe908ad81e7a6e3c984a7597c725d3889731b88dd2359e68ba3b4bec4b229eaf05d9a87c061e0fc3b2e1d2316f1ca4cec
|
data/Gemfile.lock
CHANGED
data/lib/fishplate/version.rb
CHANGED
data/lib/fishplate.rb
CHANGED
@@ -42,13 +42,26 @@ module Fishplate
|
|
42
42
|
def setup!
|
43
43
|
A9n.root.join('config/initializers').glob('*.rb').each { |f| require f }
|
44
44
|
|
45
|
-
|
45
|
+
configure_active_record
|
46
|
+
|
47
|
+
setup_database_tasks
|
48
|
+
|
49
|
+
setup_db_connection
|
50
|
+
|
51
|
+
add_sidekiq_middleware if defined?(Sidekiq)
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
def configure_active_record
|
46
57
|
ActiveRecord::Base.logger = logger
|
47
58
|
ActiveRecord::Base.time_zone_aware_attributes = true
|
48
59
|
ActiveRecord::Base.default_timezone = :utc
|
49
60
|
ActiveRecord::Base.connection_handlers = { ActiveRecord::Base.writing_role => ActiveRecord::Base.default_connection_handler }
|
50
61
|
ActiveRecord::Base.configurations = database_configuration
|
62
|
+
end
|
51
63
|
|
64
|
+
def setup_database_tasks
|
52
65
|
# Check active_record/tasks/database_tasks.rb for possible config values
|
53
66
|
ActiveRecord::Tasks::DatabaseTasks.env = A9n.env
|
54
67
|
ActiveRecord::Tasks::DatabaseTasks.database_configuration = database_configuration
|
@@ -57,17 +70,14 @@ module Fishplate
|
|
57
70
|
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = A9n.root.join('db/migrate')
|
58
71
|
ActiveRecord::Tasks::DatabaseTasks.seed_loader = self
|
59
72
|
ActiveRecord::Tasks::DatabaseTasks.root = A9n.root
|
73
|
+
end
|
60
74
|
|
75
|
+
def setup_db_connection
|
61
76
|
ActiveRecord::Base.clear_active_connections!
|
62
77
|
ActiveRecord::Base.flush_idle_connections!
|
63
|
-
|
64
78
|
ActiveRecord::Base.establish_connection
|
65
|
-
|
66
|
-
add_sidekiq_middleware if defined?(Sidekiq)
|
67
79
|
end
|
68
80
|
|
69
|
-
private
|
70
|
-
|
71
81
|
def add_sidekiq_middleware
|
72
82
|
Sidekiq.configure_server do |config|
|
73
83
|
config.server_middleware do |chain|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fishplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Knapik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: a9n
|
@@ -194,9 +194,6 @@ files:
|
|
194
194
|
- README.md
|
195
195
|
- Rakefile
|
196
196
|
- fishplate.gemspec
|
197
|
-
- fishplate/.gitignore
|
198
|
-
- fishplate/.rspec
|
199
|
-
- fishplate/.travis.yml
|
200
197
|
- lib/fishplate.rb
|
201
198
|
- lib/fishplate/rack.rb
|
202
199
|
- lib/fishplate/sidekiq_middleware.rb
|
data/fishplate/.gitignore
DELETED
data/fishplate/.rspec
DELETED