demo_mode 1.2.2 → 1.2.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: e781b6e2b4017d8efb8260570397d61579e8dd03d553bbe720f7964dae74bb53
4
- data.tar.gz: 9a1e6e3af03b1155dc9bc059d1366afb35ae1ef1a6aabe2caf86e8802eeea9d5
3
+ metadata.gz: 3032c631c3d2308b21588fe6d8598635c3a90e0be15edaae81fe9d869bd9b089
4
+ data.tar.gz: 8af75b0ceeb37fcdd98120980c3ab2ac14a18e6b503c04fbf8e3fd9eb6b47c48
5
5
  SHA512:
6
- metadata.gz: a976ad663436a8b25d20ffca633b400fb1bcd36acb62f669122159d70e4aefdc97b4c2ea6fef4f9af0135c8f55eee6456e606342acac70fd23baa799bd90d71c
7
- data.tar.gz: 88aa9c77999969cbad123ba5fdf36b4c4d92320c05833f502ec4cbc6e6a02179a6d591ae3d33463a10e1d7112c31ec957578ea65b8f19d8ff7b29c0c24c34f8e
6
+ metadata.gz: 7d5352ef735cc354a3da6260c690a1862c4e24f1adca8e91b7a8ba13944e0a1000339d3f184a8ea12b97e6578f535a040c24b17254f0c8d3cfe9131182a8d1fa
7
+ data.tar.gz: 810e15296241a0913d4c2a194eeae7577c7c6cbad58f5bc28c188fff2279eefc134368aa17e2fe14813db925192c8e1f2f1ddd88ddc9044cee92136429d93345
@@ -12,7 +12,14 @@ module DemoMode
12
12
  def current_demo_session
13
13
  if session.key?(:demo_session)
14
14
  @current_demo_session = nil if @current_demo_session&.id != session[:demo_session]['id']
15
- @current_demo_session ||= Session.find(session[:demo_session]['id'])
15
+ @current_demo_session ||= Session.find_by(id: session[:demo_session]['id'])
16
+
17
+ if @current_demo_session.nil?
18
+ session.delete(:demo_session)
19
+ sign_out
20
+ end
21
+
22
+ @current_demo_session
16
23
  end
17
24
  end
18
25
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DemoMode
4
- VERSION = '1.2.2'
4
+ VERSION = '1.2.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: demo_mode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Griffith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-13 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cli-ui