app/models/section.rb
#check if the id of the generated_section is part of an hash of hidden dependent sections and if its value is one (meaning that its hidden
#and its associated answers should be destroyed.
check if the id of the generated_section is part of an hash of hidden dependent sections and if its value is one (meaning that its hidden
and its associated answers should be destroyed.
check if the id of the generated_section is part of an hash of hidden dependent sections and if its value is one ( meaning that its hidden and its associated answers should be destroyed .
def marked_as_hidden?(hidden_hash, loop_item_id=nil)
    loop_items_ids = []
    if loop_item_id
      Array(loop_item_id).each do |item_id|
        if hidden_hash.include?(self.id.to_s + (item_id ? "_#{item_id}" : "")) && hidden_hash[self.id.to_s + (item_id ? "_#{item_id}" : "")] == "1"
          loop_items_ids << loop_item_id
        end
      end
      return loop_items_ids if loop_items_ids.present?
    else
      hidden_hash.include?(self.id.to_s) && hidden_hash[self.id.to_s] == "1"
    end
    false
  end
def marked_as_hidden? ( hidden_hash , loop_item_id = nil ) loop_items_ids = [ ] if loop_item_id Array ( loop_item_id ) . each do | item_id | if hidden_hash . include? ( self . id . to_s + ( item_id ? "_#{item_id}" : "" ) ) && hidden_hash [ self . id . to_s + ( item_id ? "_#{item_id}" : "" ) ] == "1" loop_items_ids << loop_item_id end end return loop_items_ids if loop_items_ids . present? else hidden_hash . include? ( self . id . to_s ) && hidden_hash [ self . id . to_s ] == "1" end false end
check if the id of the generated_section is part of an hash of hidden dependent sections and if its value is one (meaning that its hidden
and its associated answers should be destroyed.
check if the id of the generated_section is part of an hash of hidden dependent sections and if its value is one ( meaning that its hidden and its associated answers should be destroyed .
hidden_hash
loop_item_id