ssm_config 1.3.2 → 1.3.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: 39ea172161ade231a6b0f618af1067baa1febca0bd2cc7380b2fd37578f233ea
4
- data.tar.gz: ae8a2dd653b786e43de46199d4f64a70d93ca3d886b6f1f4913deb286d56fc9c
3
+ metadata.gz: 3b9a92069cf837609d5f479a28f031b4cca28c739d7971c08a84968800edfcc8
4
+ data.tar.gz: a102877accb35fc3658f12ddc08754af1ecd71b3d890fdaaa91eac79e5de7700
5
5
  SHA512:
6
- metadata.gz: 4a5df7293d75fc6abec8b147a2c3beaefe693069d1f946f33247eb38f9488d9ca32ad4946076bb1560957c992b30f88ae8f7cb497e32dcf4e905cd64bcdc94dc
7
- data.tar.gz: ce17d711c295fad45c24a23ec5154ba4300c2e38dff188759ec91b2d84e823f66da3c18c444d451daaf170b57faeed05407eddc4dab0fd7c8c316e1c5279fbea
6
+ metadata.gz: fbe8774054356dc71cc65cd3647504644cabceb94f30610bb3672bb41ff65872cecd716ecc6fae180baca9b4805d993b7249523f0e1fb670075c117b0a3e7399
7
+ data.tar.gz: 7a271d5eeccc19a4c8e9fc85a82d509efa3bf7a8a42b38cec94f649528ec60736724244d4b18a7062c52828a1de877f45aaba470874456c3cff07882edcbf277
@@ -9,12 +9,16 @@ module SsmConfig
9
9
  end
10
10
 
11
11
  def table_exists?
12
- return active_record_model_exists? if active_record_exists? && constant_exists?
12
+ return active_record_model_exists? if db_connected? && active_record_exists? && constant_exists?
13
13
  false
14
14
  rescue ActiveRecord::NoDatabaseError, Mysql2::Error::ConnectionError
15
15
  return false
16
16
  end
17
17
 
18
+ def db_connected?
19
+ ActiveRecord::Base.connected?
20
+ end
21
+
18
22
  def hash
19
23
  match_file = ACTIVE_RECORD_MODEL.constantize.where(:file => @file_name.to_s).order(:accessor_keys)
20
24
  hashes = match_file.each_with_object({}) { |row, hash| hash[row.accessor_keys] = transform_class(row.value, row.datatype); }
data/lib/ssm_config.rb CHANGED
@@ -7,7 +7,7 @@ require 'active_support/core_ext/hash/indifferent_access'
7
7
  require 'active_support/time'
8
8
 
9
9
  module SsmConfig
10
- VERSION = '1.3.2'.freeze
10
+ VERSION = '1.3.3'.freeze
11
11
  REFRESH_TIME = (30.minutes).freeze
12
12
 
13
13
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ssm_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santiago Herrera
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-26 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler