survey-gizmo-ruby 6.2.11 → 6.2.12

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
  SHA1:
3
- metadata.gz: 80f9cff758eafb0dc9a52c9d48c06d83094c3e6b
4
- data.tar.gz: 2715840cd27fdf996c2f72b1cd53542e32ec9913
3
+ metadata.gz: 844b6e6671c728ff6f42dc5b1ed5c73c2379540c
4
+ data.tar.gz: b3df39f6c5c5e78c55084895b6f67faf1986fe91
5
5
  SHA512:
6
- metadata.gz: 551e3c4f4a93af34edc7d06ca47576f7355453dd3625c5631e9b7a4befd957970da1d14ac2bf38296055c0d4222e3f95de41e984b9a8839c7c55cbe68ebcd4cd
7
- data.tar.gz: effefb9bda5c5d1975eaa8056b7fe4a096ea81512e046029420c5fb18eef70e7e7da7c1f72eef12a3e177c37ddd182ea73b9e8ae6ac965a5747e2cd81f742633
6
+ metadata.gz: 7a08e99da36784b02497f799b5dc81af4e2b567c9bf69e0391de39f2da6dca68fcca8efa612e8d079fc9d66e989d5e733a345de9db95ce2fdcbbd8af068579b9
7
+ data.tar.gz: 7a340eaabb357007102dc28965eb539cd3f348b7923f45e147f5c9ff45808d36e9bf00e1742ac8d2f3fa11a69bb8e7afcd72a26009cd91ed5b816e5b07853f6d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Versions
2
2
 
3
+ ## 6.2.12
4
+ * Bugfix: Don't allow option_ids of 0
5
+
3
6
  ## 6.2.11
4
7
  * Bugfix: Mask CGI escaped (percent encoded) api tokens in logs
5
8
 
@@ -23,6 +23,9 @@ module SurveyGizmo::API
23
23
  if option_id =~ /-other/
24
24
  option_id.delete!('-other"')
25
25
  self.other_text = value
26
+ elsif option_id == 0
27
+ # Option IDs of 0 seem to happen for hidden questions, even when there is answer_text
28
+ self.option_id = nil
26
29
  end
27
30
  when /\[question\((\d+)\),\s*question_pipe\("?([^"]*)"?\)\]/
28
31
  self.question_id, self.question_pipe = $1, $2
@@ -33,8 +36,9 @@ module SurveyGizmo::API
33
36
  end
34
37
 
35
38
  self.question_id = question_id.to_i
36
- if option_id
37
- fail "Bad option_id #{option_id} (class: #{option_id.class}) for #{attrs}!" if option_id.to_i == 0 && option_id != '0' && option_id != 0
39
+
40
+ if option_id && !option_id.is_a?(Fixnum)
41
+ fail "Bad option_id #{option_id} (class: #{option_id.class}) for #{attrs}!" if option_id.to_i == 0
38
42
  self.option_id = option_id.to_i
39
43
  end
40
44
  end
@@ -1,3 +1,3 @@
1
1
  module SurveyGizmo
2
- VERSION = '6.2.11'
2
+ VERSION = '6.2.12'
3
3
  end
@@ -262,7 +262,8 @@ describe 'Survey Gizmo Resource' do
262
262
  '[question(11), question_pipe(10527)]' => 'This product was too expensive',
263
263
  # Sometimes surveygizmo only includes the option with the "other" answer. =(
264
264
  '[question(12)]' => 'Other - Please explain',
265
- '[question(12), option("10017-other")]' => 'I understood...'
265
+ '[question(12), option("10017-other")]' => 'I understood...',
266
+ '[question(13), option(0)]' => '12345'
266
267
  }
267
268
  end
268
269
 
@@ -284,7 +285,8 @@ describe 'Survey Gizmo Resource' do
284
285
  { survey_id: 1, question_id: 9, option_id: 10002 },
285
286
  { survey_id: 1, question_id: 10, question_pipe: 'Que aplicación', answer_text: '5 = Extremely important' },
286
287
  { survey_id: 1, question_id: 11, question_pipe: '10527', answer_text: 'This product was too expensive' },
287
- { survey_id: 1, question_id: 12, option_id: 10017, other_text: 'I understood...' }
288
+ { survey_id: 1, question_id: 12, option_id: 10017, other_text: 'I understood...' },
289
+ { survey_id: 1, question_id: 13, answer_text: '12345' }
288
290
  ])
289
291
  end
290
292
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: survey-gizmo-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.11
4
+ version: 6.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kabari Hendrick
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-12-10 00:00:00.000000000 Z
14
+ date: 2016-12-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport