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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b859bf3d396f6ba9b213d9be337e111b39cc1a87a5ee73918d553ab03a16b7
4
- data.tar.gz: f6cab257e8b963d9f8b740a77b5a336a42403db622df72a57b51254643042117
3
+ metadata.gz: 1798fb4e1b61d82806b26b2dcf147e220b9ff5c4044a60ccb589407390695f4d
4
+ data.tar.gz: 2ccbd8b57c5c8c7edd82c512c3526d4be004363cecdf0cd710e5315db64fb39b
5
5
  SHA512:
6
- metadata.gz: 616a0dfd17908b605b99ba5bedad6c986c98affde8128c3beff540fda85040c61b86fa2ab527d762a3f820ebd3136fab97860a9dd7a9ae0679f1cf73ac4a615c
7
- data.tar.gz: 63a07f2d193d6f7e752c61f3b72a906c50059813a0204ffa480781248d00c8309c2c0a3620471b4a194db117534544e6a3b51ab6c7cc833baee199f5013df7d4
6
+ metadata.gz: 14903c29e02310555603f4298a3e930e16467bbc5495db09089eeef0d5291e998978078fc1dbd79f390bef21bea31f4e76dae7438069362aebcdaf047b22ed43
7
+ data.tar.gz: 2b96e24dbad2c2d9b71534229a267bca2c5de95d9954b43e69fdbcb9f4a22ec064d52e7ca9ce3dc941d2376f26877e086631a3aa895f5fdd7b94fac31e33e64e
@@ -1,5 +1,5 @@
1
1
  module HairTrigger
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
 
4
4
  def VERSION.<=>(other)
5
5
  split(/\./).map(&:to_i) <=> other.split(/\./).map(&:to_i)
@@ -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
- connection_pool = ActiveRecord::Base.establish_connection(db_config)
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
- ActiveRecord::SchemaDumper.dump(connection_pool.connection, file)
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.2.0
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-09-04 00:00:00.000000000 Z
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: '8'
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: '8'
32
+ version: '9'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ruby_parser
35
35
  requirement: !ruby/object:Gem::Requirement