demo_mode 1.2.1 → 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: 4fa471d71f9b23bdf5f3699471633cb453b1b71d36ef42281061803c14577eb3
4
- data.tar.gz: b02c14aa3dcebba1acfe0d1dbf46860f6a3b8a6c794b8f01a6773c2886518e41
3
+ metadata.gz: 3032c631c3d2308b21588fe6d8598635c3a90e0be15edaae81fe9d869bd9b089
4
+ data.tar.gz: 8af75b0ceeb37fcdd98120980c3ab2ac14a18e6b503c04fbf8e3fd9eb6b47c48
5
5
  SHA512:
6
- metadata.gz: 525c40df108867d7a10815cf0ab172302e1718321f560e6c5e7e449d0ad2507c4ae8fe4ee86bf054eb4e607ac2e32ea14e21f9038dae444bfe07a8db8bb188c2
7
- data.tar.gz: bfe47613f072cd372d622f3b2f38c75a1ce053fd09492c447fc22d829f3e5324d6a7dcc973a01db4bb39ca4471ccec112be9d54abd222027ef404e71cc4b7f22
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
 
data/lib/demo_mode/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cli/ui'
3
4
  require 'demo_mode/clis/multi_word_search_patch'
4
5
 
5
6
  # rubocop:disable Rails/Output, Rails/Exit
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DemoMode
4
- VERSION = '1.2.1'
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.1
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