think_feel_do_engine 3.21.1 → 3.21.2

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
  SHA1:
3
- metadata.gz: 20f20efba264a83a66b5d1824cae5ec07e8ef288
4
- data.tar.gz: c30f8503fa62eb29007585f29f0c8cc6dfe66c39
3
+ metadata.gz: 3ff553dad57d0ae0a68326a83dd251c9f44037c2
4
+ data.tar.gz: ef4e2750dd4cfe73e15445ac1c3303a7fedbf3d8
5
5
  SHA512:
6
- metadata.gz: d77b928f8354233495ac71d69f461b41664089c3561c08e2dc70814d2e37c633f43123c09c5addbea86f8f544ef578528f209aaa3d92fdeea41ee7a4f96b656d
7
- data.tar.gz: bb916dabaf273b4e6c552d58760d28476b69b2e51a9769fdf7dc9e92640e710bc2739fb5fdfb4411a39fb3dcf8f4ebd54dd7f93f0e12b7f83f8011c897166b43
6
+ metadata.gz: ece5a0cd2dac5b4f0f8ad8f58cdef342323fab606075c5ecfe077d12f9bc7c5e0141f5f763d9704ff15c81f7f36c2792930f81129ee4d0bbda587d3fe227f93b
7
+ data.tar.gz: 73a185e725ad537b6543f8aae77ccc55b03a78778c725089f0b326cd6d344f72b86339053d31d34a02e15cc0003f10de494012994abc566160b428361c9887cd
@@ -42,7 +42,6 @@ module ThinkFeelDoEngine
42
42
  def show_next_content
43
43
  mark_engagement_completed
44
44
  @navigator.fetch_next_content
45
-
46
45
  if @navigator.current_module
47
46
  redirect_to navigator_location_path(
48
47
  module_id: @navigator.current_module.try(:id),
@@ -122,10 +121,10 @@ module ThinkFeelDoEngine
122
121
  end
123
122
 
124
123
  def mark_engagement_completed
125
- if navigator_content_module && last_engagement &&
126
- !@navigator.current_content_provider.exists?(
127
- @navigator.content_position + 1
128
- )
124
+ if navigator_content_module &&
125
+ last_engagement &&
126
+ last_slideshow_of_engagement? &&
127
+ provider_last_page?
129
128
  last_engagement.update_attributes(completed_at: DateTime.current)
130
129
  end
131
130
  end
@@ -134,6 +133,25 @@ module ThinkFeelDoEngine
134
133
  !provider_id.blank? && !content_id.blank?
135
134
  end
136
135
 
136
+ def provider_last_page?
137
+ !@navigator
138
+ .current_content_provider
139
+ .exists?(@navigator.content_position + 1)
140
+ end
141
+
142
+ def last_slideshow
143
+ navigator_content_module
144
+ .content_providers
145
+ .where(type: BitCore::ContentProviders::SlideshowProvider)
146
+ .order(position: :asc)
147
+ .last
148
+ end
149
+
150
+ def last_slideshow_of_engagement?
151
+ @navigator
152
+ .current_content_provider == last_slideshow
153
+ end
154
+
137
155
  def module_exist?
138
156
  @navigator
139
157
  .current_module
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # nodoc
3
3
  module ThinkFeelDoEngine
4
- VERSION = "3.21.1"
4
+ VERSION = "3.21.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: think_feel_do_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.21.1
4
+ version: 3.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Carty-Fickes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-24 00:00:00.000000000 Z
11
+ date: 2016-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails