effective_questions 0.0.6 → 0.0.7

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
  SHA256:
3
- metadata.gz: '008179067583bc318ab1bbb938c8bc75cd63081f75ffeb729ce46439184c50c3'
4
- data.tar.gz: df183798daa78e2ce0a044073a1e02f35a20bb7ddca26d44380b364e7cda9668
3
+ metadata.gz: eeedf279b6f22712de6660c95688dce2fe98f9cc9b6f64eed598b9775f1e9007
4
+ data.tar.gz: 05b0e4caefcb56a2cc1890f1bdb2a88dc1fe1d13bc58053426c9ebe3435600e1
5
5
  SHA512:
6
- metadata.gz: eb8aad008146a2eaa365ca95dd9c43167dd2b5b20b5fa570718d492220a43548f940a6345d4fde38e5ab21be3852ba055921242c02bbc97a5c43471e9dfa4055
7
- data.tar.gz: 908ae6763ac6928b69b79324b8e639b3aedf95598863b0e5f3fdc27e96918b0732a3bce13ce455461dbbf5bea314da6b6ec8e2868cf6faea773e58b56dd4cbe5
6
+ metadata.gz: dca07b8bae0ae93aeaa8d4262389c3f85b9cba0a0fee568db32b3cbf4f5e90f33aba0a9b04cb4a32b93201a081006a7b68725c2e8cfd751dfec8e64e2aeb7a1f
7
+ data.tar.gz: 6c5e74c389d2613e65401c907c9dcc512d953bb367313e27b209703c5195f6c4ca2acc349ae206122268c65881c968521ce097e4e48656d7476ef7a85ebe5766
@@ -23,8 +23,12 @@ module ActsAsQuestionable
23
23
  end
24
24
 
25
25
  def completed_responses(question: nil)
26
- return responses.select(&:completed?) if question.nil?
27
- responses.select { |response| response.completed? && response.question_id == question.id }
26
+ @_acts_as_questionable_responses ||= responses
27
+ .includes(:question, :responsable, :question_options, response_options: :question_option)
28
+ .select(&:completed?)
29
+
30
+ return @_acts_as_questionable_responses if question.blank?
31
+ @_acts_as_questionable_responses.select { |response| response.question_id == question.id }
28
32
  end
29
33
 
30
34
  def questionable_scored?
@@ -1,3 +1,3 @@
1
1
  module EffectiveQuestions
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_questions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-13 00:00:00.000000000 Z
11
+ date: 2026-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails