app/strategies/passage_updater.rb
# Edits an existing Passage row assuming its new timing value is specified as
# an incremental timing.
# This method updates also the internal SQL diff log file.
#
# == Returns:
#
# The specified Passage instance.
# +nil+ only in case of errors.
#
Edits an existing Passage row assuming its new timing value is specified as
an incremental timing.
This method updates also the internal SQL diff log file.



The specified Passage instance.
+nil+ only in case of errors.
Edits an existing Passage row assuming its new timing value is specified as an incremental timing . This method updates also the internal SQL diff log file . The specified Passage instance . + nil + only in case of errors .
def edit_existing_row!( passage, timing_instance, reaction_time_instance = nil,
                          meeting_program_id = nil, swimmer_id = nil, team_id = nil )
    return nil unless passage && timing_instance
    passage = prepare_passage_fields( passage, timing_instance, reaction_time_instance,
                                      passage.meeting_individual_result, passage.passage_type_id,
                                      meeting_program_id, swimmer_id, team_id )
    passage.save!
    sql_attributes = passage.attributes.select do |key|
      [
        'id', 'minutes', 'seconds', 'hundreds',
        'reaction_time',
        'minutes_from_start', 'seconds_from_start', 'hundreds_from_start',
        'user_id'
      ].include?( key.to_s )
    end
    sql_diff_text_log << to_sql_update( passage, false, sql_attributes, "\r\n" )
    passage
  end
def edit_existing_row! ( passage , timing_instance , reaction_time_instance = nil , meeting_program_id = nil , swimmer_id = nil , team_id = nil ) return nil unless passage && timing_instance passage = prepare_passage_fields ( passage , timing_instance , reaction_time_instance , passage . meeting_individual_result , passage . passage_type_id , meeting_program_id , swimmer_id , team_id ) passage . save! sql_attributes = passage . attributes . select do | key | [ 'id' , 'minutes' , 'seconds' , 'hundreds' , 'reaction_time' , 'minutes_from_start' , 'seconds_from_start' , 'hundreds_from_start' , 'user_id' ] . include? ( key . to_s ) end sql_diff_text_log << to_sql_update ( passage , false , sql_attributes , "\r\n" ) passage end
Edits an existing Passage row assuming its new timing value is specified as
an incremental timing.
Edits an existing Passage row assuming its new timing value is specified as an incremental timing .
# DEBUG #    puts "\r\nedit_existing_row( passage.id: #{ passage.id }, timing: #{ timing_instance }, reaction_time: #{ reaction_time_instance })" #    puts "before UPDATE" # Store Db-diff text for UPDATE
passage
<not_specific>
timing_instance
<not_specific>
reaction_time_instance
<not_specific>
meeting_program_id
<not_specific>
swimmer_id
<not_specific>
team_id
<not_specific>