Class: PermittedParams

Inherits:
Struct
  • Object
show all
Defined in:
app/models/permitted_params.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



1
2
3
# File 'app/models/permitted_params.rb', line 1

def params
  @params
end

Instance Method Details

#answerObject

answer



47
48
49
# File 'app/models/permitted_params.rb', line 47

def answer
  strong_parameters.permit(*answer_attributes)
end

#answer_attributesObject



50
51
52
# File 'app/models/permitted_params.rb', line 50

def answer_attributes
  [:question, :question_id, :text, :short_text, :help_text, :weight, :response_class, :reference_identifier, :data_export_identifier, :common_namespace, :common_identifier, :display_order, :is_exclusive, :display_length, :custom_class, :custom_renderer, :default_value, :display_type, :input_mask, :input_mask_placeholder]
end

#dependencyObject

dependency



55
56
57
# File 'app/models/permitted_params.rb', line 55

def dependency
  strong_parameters.permit(*dependency_attributes)
end

#dependency_attributesObject



58
59
60
# File 'app/models/permitted_params.rb', line 58

def dependency_attributes
  [:question, :question_group, :question_id, :question_group_id, :rule]
end

#dependency_conditionObject

dependency_condition



63
64
65
# File 'app/models/permitted_params.rb', line 63

def dependency_condition
  strong_parameters.permit(*dependency_condition_attributes)
end

#dependency_condition_attributesObject



66
67
68
# File 'app/models/permitted_params.rb', line 66

def dependency_condition_attributes
  [:dependency, :question, :answer, :dependency_id, :rule_key, :question_id, :operator, :answer_id, :datetime_value, :integer_value, :float_value, :unit, :text_value, :string_value, :response_other, :question_reference, :answer_reference]
end

#questionObject

question



31
32
33
# File 'app/models/permitted_params.rb', line 31

def question
  strong_parameters.permit(*question_attributes)
end

#question_attributesObject



34
35
36
# File 'app/models/permitted_params.rb', line 34

def question_attributes
  [:survey_section, :question_group, :survey_section_id, :question_group_id, :text, :short_text, :help_text, :pick, :reference_identifier, :data_export_identifier, :common_namespace, :common_identifier, :display_order, :display_type, :is_mandatory, :display_width, :custom_class, :custom_renderer, :correct_answer_id]
end

#question_groupObject

question_group



39
40
41
# File 'app/models/permitted_params.rb', line 39

def question_group
  strong_parameters.permit(*question_group_attributes)
end

#question_group_attributesObject



42
43
44
# File 'app/models/permitted_params.rb', line 42

def question_group_attributes
  [:text, :help_text, :reference_identifier, :data_export_identifier, :common_namespace, :common_identifier, :display_type, :custom_class, :custom_renderer]
end

#responseObject

response



87
88
89
# File 'app/models/permitted_params.rb', line 87

def response
  strong_parameters.permit(*response_attributes)
end

#response_attributesObject



90
91
92
# File 'app/models/permitted_params.rb', line 90

def response_attributes
  [:response_set, :question, :answer, :date_value, :time_value, :response_set_id, :question_id, :answer_id, :datetime_value, :integer_value, :float_value, :unit, :text_value, :string_value, :response_other, :response_group, :survey_section_id]
end

#response_setObject

response_set



95
96
97
# File 'app/models/permitted_params.rb', line 95

def response_set
  strong_parameters.permit(*response_set_attributes)
end

#response_set_attributesObject



98
99
100
# File 'app/models/permitted_params.rb', line 98

def response_set_attributes
  [:survey, :responses_attributes, :user_id, :survey_id]
end

#strong_parametersObject



3
4
5
# File 'app/models/permitted_params.rb', line 3

def strong_parameters
  ActionController::Parameters.new(params)
end

#surveyObject

survey



7
8
9
# File 'app/models/permitted_params.rb', line 7

def survey
  strong_parameters.permit(*survey_attributes)
end

#survey_attributesObject



10
11
12
# File 'app/models/permitted_params.rb', line 10

def survey_attributes
  [:title, :description, :reference_identifier, :data_export_identifier, :common_namespace, :common_identifier, :css_url, :custom_class, :display_order]
end

#survey_sectionObject

survey_section



23
24
25
# File 'app/models/permitted_params.rb', line 23

def survey_section
  strong_parameters.permit(*survey_section_attributes)
end

#survey_section_attributesObject



26
27
28
# File 'app/models/permitted_params.rb', line 26

def survey_section_attributes
  [:survey, :survey_id, :title, :description, :reference_identifier, :data_export_identifier, :common_namespace, :common_identifier, :custom_class, :display_order]
end

#survey_translationObject

survey_translation



15
16
17
# File 'app/models/permitted_params.rb', line 15

def survey_translation
  strong_parameters.permit(*survey_translation_attributes)
end

#survey_translation_attributesObject



18
19
20
# File 'app/models/permitted_params.rb', line 18

def survey_translation_attributes
  [:survey, :survey_id, :locale, :translation]
end

#validationObject

validation



71
72
73
# File 'app/models/permitted_params.rb', line 71

def validation
  strong_parameters.permit(*validation_attributes)
end

#validation_attributesObject



74
75
76
# File 'app/models/permitted_params.rb', line 74

def validation_attributes
  [:answer, :answer_id, :rule, :message]
end

#validation_conditionObject

validation_condition



79
80
81
# File 'app/models/permitted_params.rb', line 79

def validation_condition
  strong_parameters.permit(*validation_condition_attributes)
end

#validation_condition_attributesObject



82
83
84
# File 'app/models/permitted_params.rb', line 82

def validation_condition_attributes
  [:validation, :validation_id, :rule_key, :operator, :question_id, :answer_id, :datetime_value, :integer_value, :float_value, :unit, :text_value, :string_value, :response_other, :regexp]
end