app/models/section_nested_item.rb
def update_section_nested_item(old_sni, new_sni)
    old_sni.position = new_sni[:position]
    old_sni.program_var = new_sni[:program_var]
    old_sni.question_id = new_sni[:question_id]
    old_sni.nested_section_id = new_sni[:nested_section_id]
    old_sni.response_set_id = new_sni[:response_set_id]
    # While this seems unecessary, checking changed? here improves
    old_sni.save! if old_sni.changed?
    old_sni
  end
# old_sni is a SectionNestedItem, new_sni is hash representing a new section nested item from the request params
old_sni is a SectionNestedItem, new_sni is hash representing a new section nested item from the request params
old_sni is a SectionNestedItem new_sni is hash representing a new section nested item from the request params
def update_section_nested_item(old_sni, new_sni)
    old_sni.position = new_sni[:position]
    old_sni.program_var = new_sni[:program_var]
    old_sni.question_id = new_sni[:question_id]
    old_sni.nested_section_id = new_sni[:nested_section_id]
    old_sni.response_set_id = new_sni[:response_set_id]
    old_sni.save! if old_sni.changed?
    old_sni
  end
def update_section_nested_item ( old_sni , new_sni ) old_sni . position = new_sni [ :position ] old_sni . program_var = new_sni [ :program_var ] old_sni . question_id = new_sni [ :question_id ] old_sni . nested_section_id = new_sni [ :nested_section_id ] old_sni . response_set_id = new_sni [ :response_set_id ] old_sni . save! if old_sni . changed? old_sni end
old_sni is a SectionNestedItem, new_sni is hash representing a new section nested item from the request params
old_sni is a SectionNestedItem new_sni is hash representing a new section nested item from the request params
# While this seems unecessary, checking changed? here improves
old_sni
new_sni