diff --git a/lib/surveyor/models/answer_methods.rb b/lib/surveyor/models/answer_methods.rb index e685b208..5ea3b484 100644 --- a/lib/surveyor/models/answer_methods.rb +++ b/lib/surveyor/models/answer_methods.rb @@ -12,7 +12,7 @@ module AnswerMethods belongs_to :question has_many :responses has_many :validations, :dependent => :destroy - attr_accessible *PermittedParams.new.answer_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.answer_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :text diff --git a/lib/surveyor/models/dependency_condition_methods.rb b/lib/surveyor/models/dependency_condition_methods.rb index 2c3aed03..1d744ff6 100644 --- a/lib/surveyor/models/dependency_condition_methods.rb +++ b/lib/surveyor/models/dependency_condition_methods.rb @@ -12,7 +12,7 @@ module DependencyConditionMethods belongs_to :dependency belongs_to :dependent_question, :foreign_key => :question_id, :class_name => :question belongs_to :question - attr_accessible *PermittedParams.new.dependency_condition_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.dependency_condition_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :operator, :rule_key diff --git a/lib/surveyor/models/dependency_methods.rb b/lib/surveyor/models/dependency_methods.rb index 7d06a531..0792554a 100644 --- a/lib/surveyor/models/dependency_methods.rb +++ b/lib/surveyor/models/dependency_methods.rb @@ -10,7 +10,7 @@ module DependencyMethods belongs_to :question belongs_to :question_group has_many :dependency_conditions, :dependent => :destroy - attr_accessible *PermittedParams.new.dependency_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.dependency_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :rule @@ -54,4 +54,4 @@ def conditions_hash(response_set) end end end -end \ No newline at end of file +end diff --git a/lib/surveyor/models/question_group_methods.rb b/lib/surveyor/models/question_group_methods.rb index 5ba6bdce..9c092311 100644 --- a/lib/surveyor/models/question_group_methods.rb +++ b/lib/surveyor/models/question_group_methods.rb @@ -12,7 +12,7 @@ module QuestionGroupMethods # Associations has_many :questions has_one :dependency - attr_accessible *PermittedParams.new.question_group_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.question_group_attributes unless defined? ActiveModel::ForbiddenAttributesProtection end # Instance Methods @@ -59,4 +59,4 @@ def translation(locale) end end end -end \ No newline at end of file +end diff --git a/lib/surveyor/models/question_methods.rb b/lib/surveyor/models/question_methods.rb index 0588406f..b2e1d229 100644 --- a/lib/surveyor/models/question_methods.rb +++ b/lib/surveyor/models/question_methods.rb @@ -15,7 +15,7 @@ module QuestionMethods has_many :answers, :dependent => :destroy # it might not always have answers has_one :dependency, :dependent => :destroy belongs_to :correct_answer, :class_name => "Answer", :dependent => :destroy - attr_accessible *PermittedParams.new.question_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.question_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :text, :display_order diff --git a/lib/surveyor/models/response_methods.rb b/lib/surveyor/models/response_methods.rb index e062804f..d4bee915 100644 --- a/lib/surveyor/models/response_methods.rb +++ b/lib/surveyor/models/response_methods.rb @@ -11,7 +11,7 @@ module ResponseMethods belongs_to :response_set belongs_to :question belongs_to :answer - attr_accessible *PermittedParams.new.response_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.response_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :question_id, :answer_id diff --git a/lib/surveyor/models/response_set_methods.rb b/lib/surveyor/models/response_set_methods.rb index ceee020d..5e893853 100644 --- a/lib/surveyor/models/response_set_methods.rb +++ b/lib/surveyor/models/response_set_methods.rb @@ -11,7 +11,7 @@ module ResponseSetMethods belongs_to :user has_many :responses, :dependent => :destroy accepts_nested_attributes_for :responses, :allow_destroy => true - attr_accessible *PermittedParams.new.response_set_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.response_set_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :survey_id diff --git a/lib/surveyor/models/survey_methods.rb b/lib/surveyor/models/survey_methods.rb index 1e9b406c..1dee6a0b 100644 --- a/lib/surveyor/models/survey_methods.rb +++ b/lib/surveyor/models/survey_methods.rb @@ -13,7 +13,7 @@ module SurveyMethods has_many :sections, class_name: 'SurveySection', :dependent => :destroy has_many :response_sets has_many :translations, :class_name => "SurveyTranslation" - attr_accessible *PermittedParams.new.survey_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.survey_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :title diff --git a/lib/surveyor/models/survey_section_methods.rb b/lib/surveyor/models/survey_section_methods.rb index e73920ca..5aedcea0 100644 --- a/lib/surveyor/models/survey_section_methods.rb +++ b/lib/surveyor/models/survey_section_methods.rb @@ -9,7 +9,7 @@ module SurveySectionMethods # Associations has_many :questions, :dependent => :destroy belongs_to :survey - attr_accessible *PermittedParams.new.survey_section_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.survey_section_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :title, :display_order diff --git a/lib/surveyor/models/survey_translation_methods.rb b/lib/surveyor/models/survey_translation_methods.rb index 836afa20..ef8f962b 100644 --- a/lib/surveyor/models/survey_translation_methods.rb +++ b/lib/surveyor/models/survey_translation_methods.rb @@ -8,7 +8,7 @@ module SurveyTranslationMethods included do # Associations belongs_to :survey - attr_accessible *PermittedParams.new.survey_translation_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.survey_translation_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :locale, :translation @@ -25,4 +25,4 @@ def default_args end end end -end \ No newline at end of file +end diff --git a/lib/surveyor/models/validation_condition_methods.rb b/lib/surveyor/models/validation_condition_methods.rb index 24ecc252..c822b55d 100644 --- a/lib/surveyor/models/validation_condition_methods.rb +++ b/lib/surveyor/models/validation_condition_methods.rb @@ -9,7 +9,7 @@ module ValidationConditionMethods included do # Associations belongs_to :validation - attr_accessible *PermittedParams.new.validation_condition_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.validation_condition_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :operator, :rule_key diff --git a/lib/surveyor/models/validation_methods.rb b/lib/surveyor/models/validation_methods.rb index 76417c0a..469b78ed 100644 --- a/lib/surveyor/models/validation_methods.rb +++ b/lib/surveyor/models/validation_methods.rb @@ -9,7 +9,7 @@ module ValidationMethods # Associations belongs_to :answer has_many :validation_conditions, :dependent => :destroy - attr_accessible *PermittedParams.new.validation_attributes if defined? ActiveModel::MassAssignmentSecurity + attr_accessible *PermittedParams.new.validation_attributes unless defined? ActiveModel::ForbiddenAttributesProtection # Validations validates_presence_of :rule @@ -38,4 +38,4 @@ def conditions_hash(response_set) end end end -end \ No newline at end of file +end