effective_questions 0.0.6 → 0.0.8

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: c4e83f963e30f4efafc5f5539c6028a0eab34fbc46dda0419a22c78cb84ce192
4
+ data.tar.gz: e51b3d7c4f4823fb4fc273e6918f24a3132b9a3e3cf904fa5953e3ae5110d0c5
5
5
  SHA512:
6
- metadata.gz: eb8aad008146a2eaa365ca95dd9c43167dd2b5b20b5fa570718d492220a43548f940a6345d4fde38e5ab21be3852ba055921242c02bbc97a5c43471e9dfa4055
7
- data.tar.gz: 908ae6763ac6928b69b79324b8e639b3aedf95598863b0e5f3fdc27e96918b0732a3bce13ce455461dbbf5bea314da6b6ec8e2868cf6faea773e58b56dd4cbe5
6
+ metadata.gz: 88f4d8f5c5ff15d403e8084a7ee8cc0ea2e504eb3182d340f563533bed7c9954464af9dc63f4bc80c60116107a8fe6f8b964428fff0951c5739fb0e613e2d085
7
+ data.tar.gz: 1380ca24cb9fe8dc01a869f095e5f82998760e8203ba8c029cccecf828f1eee08f549118336e7ce2be73c9ee8e2f9d8a536b9c2a0fffea1b4c12e7d574a7f769
@@ -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?
@@ -9,6 +9,8 @@ module Effective
9
9
 
10
10
  has_one_attached :upload_file
11
11
 
12
+ log_changes(to: :responsable) if respond_to?(:log_changes)
13
+
12
14
  effective_resource do
13
15
  # The response
14
16
  date :date
@@ -103,6 +105,12 @@ module Effective
103
105
  question&.category_partial
104
106
  end
105
107
 
108
+ def log_changes?
109
+ return responsable.log_changes? if responsable.respond_to?(:log_changes?)
110
+
111
+ true
112
+ end
113
+
106
114
  def completed?
107
115
  responsable.responsable_completed?
108
116
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveQuestions
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.8'
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.8
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-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails