bard-rake 0.18.0 → 0.18.3

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: cef03634f53844e05848762de6241e42ccbf4ec3036c505f58e24dc3492826cf
4
- data.tar.gz: c1ad30e5b5e7cb68593a07bb8d9ef0d87b3cc260a1f5aa79ae68bd6bc9de6101
3
+ metadata.gz: 38773c410d093bc039c0ffd18bba5cb685a386950bc79637663d236bde41f084
4
+ data.tar.gz: 79cecaa68b6db7e870ba3fd0abe43155ac6b9301d119d83bedced297b2cdc95b
5
5
  SHA512:
6
- metadata.gz: 7136e73f23f0c82e3fe94467b29d958377825dce071e9293c7f5b24062d4ab2579d3f8abce59b67b2b5ef8ce64b1768eab82d5e764d426d7ee61e7a0b720c8ae
7
- data.tar.gz: 8b55fa6283e4450ef582103d5f6ce299d25a8e8e158e7e84d5563b5e8dee74c001fa7562f45a613fce3c1834cd1cb30f78ec6d1fc3eb75e6ea034c0395f02f44
6
+ metadata.gz: a6acaddff47bb7c664f04c050d7d3df6b07fac32b140250f0a504ede020da0754107881597ae36edf2ede949e39a8e9176bdbda49b9ff19ce4e964dc12ea4161
7
+ data.tar.gz: f94310bfa99cc38d836f719a2d326276108eb748d84283912e68d7ea56a445f3f571295fa0e76613bced6fadda0b525e8c2358ad8f337b549e10772d85d79a77
@@ -17,15 +17,23 @@ if defined?(ActiveRecord)
17
17
  namespace :db do
18
18
  namespace :create do
19
19
  task :current => :load_config do
20
- config = ActiveRecord::Tasks::DatabaseTasks.current_config
21
- ActiveRecord::Tasks::DatabaseTasks.create config
20
+ if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:current_config)
21
+ config = ActiveRecord::Tasks::DatabaseTasks.current_config
22
+ ActiveRecord::Tasks::DatabaseTasks.create config
23
+ else
24
+ ActiveRecord::Tasks::DatabaseTasks.create_current Rails.env
25
+ end
22
26
  end
23
27
  end
24
28
 
25
29
  namespace :drop do
26
30
  task :current => :load_config do
27
- config = ActiveRecord::Tasks::DatabaseTasks.current_config
28
- ActiveRecord::Tasks::DatabaseTasks.drop config
31
+ if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:current_config)
32
+ config = ActiveRecord::Tasks::DatabaseTasks.current_config
33
+ ActiveRecord::Tasks::DatabaseTasks.drop config
34
+ else
35
+ ActiveRecord::Tasks::DatabaseTasks.drop_current Rails.env
36
+ end
29
37
  end
30
38
  end
31
39
  end
@@ -56,8 +56,13 @@ if defined?(ActiveRecord)
56
56
 
57
57
  ActiveRecord::Base.configurations.configs_for.each do |db_config|
58
58
  env = db_config.env_name
59
- configuration = db_config.config
60
- database = configuration["database"]
59
+ if Rails.version < "7"
60
+ configuration = db_config.config
61
+ database = configuration["database"]
62
+ else
63
+ configuration = db_config.configuration_hash
64
+ database = configuration[:database]
65
+ end
61
66
 
62
67
  next unless database
63
68
  next unless whitelist.include?(env)
@@ -1,6 +1,6 @@
1
1
  module Bard
2
2
  module Rake
3
- VERSION = "0.18.0"
3
+ VERSION = "0.18.3"
4
4
  end
5
5
  end
6
6
 
@@ -30,7 +30,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
30
30
  end
31
31
 
32
32
  def collation
33
- "utf8mb4_general_ci"
33
+ "utf8mb4_unicode_ci"
34
34
  end
35
35
 
36
36
  def db
@@ -17,9 +17,7 @@ module Bard
17
17
 
18
18
  def specify_charset_and_collation_in_database_yml
19
19
  ["config/database.yml", "config/database.sample.yml"].each do |file|
20
- [" collation: utf8mb4_general_ci\n", " charset: utf8mb4\n"].each do |line|
21
- inject_into_file file, line, after: " socket: /var/run/mysqld/mysqld.sock\n"
22
- end
20
+ inject_into_file file, " charset: utf8mb4\n", after: " socket: /var/run/mysqld/mysqld.sock\n"
23
21
  end
24
22
  end
25
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-30 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake