focus_common 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c31f69a408d2cfb5939ffe8d2ca9ee7056f37e0ae3f4931af246450191cf036d
4
- data.tar.gz: b63ebb1cac3cd016f896547348e9be1a6716b2141000862f16cb3c52a940f63f
3
+ metadata.gz: f09b9d81be06a20bd600ef7590a887e3ef9cf21c1fb92a491e64a67c39b5f31b
4
+ data.tar.gz: 8bb58fca0eadaa64e3bafdfc6b08b941fa55fb59dff715c9fc9d28941ffd1ec5
5
5
  SHA512:
6
- metadata.gz: 48e79968501e3702b51aa71111995c02665524b327277ec971e9e9332d881d0d86191d0352a03610ee850a146464a0534378d30d82814cce2525254f18a74c11
7
- data.tar.gz: e0a2d41166292f43e377de8dbb2233fe4f704861c1286496e62674a59a7eead8bc29876ab6d6cb1081a5b8c4d5744b982625208dce0fa9470a296fc9755c19aa
6
+ metadata.gz: cece40964b5c2aa9a0e289a47afb8955ce6e2c863b266cd2435c71d4f73a25104be2961baf935404eeb47a0d1e9fb98ee1c18b8ef568b83b6dd130552d8c8c38
7
+ data.tar.gz: 24b4b5d04aeabaaa05929d18de43a05db532dad28970c4fd3fc670d64425c90934334e8c1a31d82e822549c3a448843e325d206997b838dd5a60fa066a4fd35c
@@ -13,12 +13,26 @@ class FocusCommon::AppInfo
13
13
 
14
14
  def get_database_info
15
15
  conn = ActiveRecord::Base.connection
16
- if conn.class.name.demodulize == 'Mysql2Adapter'
17
- {version: conn.select_value("SELECT @@version"),
18
- }
16
+ adapter = conn.adapter_name
17
+
18
+ sql = \
19
+ case adapter
20
+ when "MSSQL"
21
+ "SELECT @@VERSION"
22
+ when "MySQL", "Mysql2", "PostgreSQL"
23
+ "SELECT VERSION()"
24
+ when "SQLServer"
25
+ "SELECT @@VERSION"
26
+ when "OracleEnhanced"
27
+ "SELECT * FROM V$VERSION"
28
+ when "SQLite"
29
+ "SELECT SQLITE_VERSION()"
19
30
  else
20
- {}
31
+ nil
21
32
  end
33
+
34
+ v = sql ? conn.select_value(sql) : nil
35
+ {version: v}
22
36
  end
23
37
 
24
38
  def git_version
@@ -1,3 +1,3 @@
1
1
  module FocusCommon
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: focus_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - linjunhalida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-10 00:00:00.000000000 Z
11
+ date: 2025-01-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Common library for Focus Solution Inc Rails projects
14
14
  email: