hairtrigger 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hair_trigger/version.rb +1 -1
- data/lib/tasks/hair_trigger.rake +11 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1798fb4e1b61d82806b26b2dcf147e220b9ff5c4044a60ccb589407390695f4d
|
4
|
+
data.tar.gz: 2ccbd8b57c5c8c7edd82c512c3526d4be004363cecdf0cd710e5315db64fb39b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14903c29e02310555603f4298a3e930e16467bbc5495db09089eeef0d5291e998978078fc1dbd79f390bef21bea31f4e76dae7438069362aebcdaf047b22ed43
|
7
|
+
data.tar.gz: 2b96e24dbad2c2d9b71534229a267bca2c5de95d9954b43e69fdbcb9f4a22ec064d52e7ca9ce3dc941d2376f26877e086631a3aa895f5fdd7b94fac31e33e64e
|
data/lib/hair_trigger/version.rb
CHANGED
data/lib/tasks/hair_trigger.rake
CHANGED
@@ -20,19 +20,28 @@ namespace :db do
|
|
20
20
|
|
21
21
|
ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |name|
|
22
22
|
db_config = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: name)
|
23
|
-
|
23
|
+
connection = get_connection(ActiveRecord::Base.establish_connection(db_config))
|
24
24
|
|
25
25
|
filename = dump_filename(db_config.name)
|
26
26
|
ActiveRecord::SchemaDumper.previous_schema = File.exist?(filename) ? File.read(filename) : nil
|
27
27
|
|
28
28
|
File.open(filename, "w") do |file|
|
29
|
-
|
29
|
+
|
30
|
+
ActiveRecord::SchemaDumper.dump(connection, file)
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
34
|
Rake::Task["db:schema:dump"].reenable
|
34
35
|
end
|
35
36
|
|
37
|
+
def get_connection(connection_pool)
|
38
|
+
if Gem::Version.new("7.2.0") <= ActiveRecord.gem_version
|
39
|
+
connection_pool
|
40
|
+
else
|
41
|
+
connection_pool.connection
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
36
45
|
def schema_file_type(format)
|
37
46
|
case format
|
38
47
|
when :ruby
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hairtrigger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '9'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '9'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: ruby_parser
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|