semian 0.13.1 → 0.13.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/semian/rails.rb +28 -7
- data/lib/semian/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540294c5a9ecdfdcbafcdc1485afd1314a94fd869501bc6795ee327606d3e799
|
4
|
+
data.tar.gz: 5855959232d25ea3c2da1f7ca7096c18afb15161ac8116e8f1ece9792fd456e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7549cd0c6dc515733612fcd7b200c23467104c5616ff9501b65a554712e0449d07d8d2d479b45962cffb87c8e6cd2fc82d695a1d9f399a5724b3b4c241c59a8
|
7
|
+
data.tar.gz: cf31ff975016b22e101db10813d73ab8288584657c9f7319ef222790dcd052d3ab45caedcca2639140d2199be87d1f790f0c82edf918d388c669f9be68b467f2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# v0.13.2
|
4
|
+
|
5
|
+
* Fix: Update AbstractAdapter patch to accomodate recent Rails changes. (#364)
|
6
|
+
|
3
7
|
# v0.13.1
|
4
8
|
|
5
9
|
* Fix: Raise `Redis::OutOfMemoryError` for messages that match `OOM command not allowed when used memory > 'maxmemory'` rather than checking `start_with?("OOM ")`. (#367)
|
data/lib/semian/rails.rb
CHANGED
@@ -2,14 +2,35 @@
|
|
2
2
|
|
3
3
|
require "active_record/connection_adapters/abstract_adapter"
|
4
4
|
|
5
|
-
module
|
6
|
-
module
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
module Semian
|
6
|
+
module Rails
|
7
|
+
def semian_resource
|
8
|
+
@semian_resource ||= client_connection.semian_resource
|
9
|
+
end
|
10
|
+
|
11
|
+
def reconnect
|
12
|
+
@semian_resource = nil
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
# client_connection is an instance of a Mysql2::Client
|
19
|
+
#
|
20
|
+
# The conditionals here support multiple Rails versions.
|
21
|
+
# - valid_raw_connection is for 7.1.x and above
|
22
|
+
# - @raw_connection is for 7.0.x
|
23
|
+
# - @connection is for versions below 6.1.x and below
|
24
|
+
def client_connection
|
25
|
+
if respond_to?(:valid_raw_connection)
|
26
|
+
valid_raw_connection
|
27
|
+
elsif instance_variable_defined?(:@raw_connection)
|
28
|
+
@raw_connection
|
29
|
+
else
|
30
|
+
@connection
|
12
31
|
end
|
13
32
|
end
|
14
33
|
end
|
15
34
|
end
|
35
|
+
|
36
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(Semian::Rails)
|
data/lib/semian/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Francis
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-08-
|
13
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: |2
|
16
16
|
A Ruby C extention that is used to control access to shared resources
|