app/strategies/relay_swimmer_updater.rb
def create_new_row!( mrr, relay_order, swimmer_id, badge_id, stroke_type_id, timing_instance, reaction_time_instance )
    return nil unless swimmer_id.present? && badge_id.present? && relay_order.present?
    mrs = MeetingRelaySwimmer.new(
      meeting_relay_result_id: mrr.id,
      relay_order:    relay_order,
      swimmer_id:     swimmer_id,
      badge_id:       badge_id,
      minutes:        timing_instance ? timing_instance.minutes : 0,
      seconds:        timing_instance ? timing_instance.seconds : 0,
      hundreds:       timing_instance ? timing_instance.hundreds : 0,
      reaction_time:  reaction_time_instance ? reaction_time_instance.to_hundreds / 100.0 : 0.0,
      stroke_type_id: stroke_type_id,
      user_id:        @current_user.id
    )
# DEBUG
#    puts "before SAVE!"
#    puts ValidationErrorTools.recursive_error_for( mrs ) unless mrs.valid?
    mrs.save!
    # Store Db-diff text for INSERT
    sql_diff_text_log << to_sql_insert( mrs, false, "\r\n" )

    mrs
  end
# Creates a new row given its parent mrr id and its other values.
#
# This method updates also the internal SQL diff log file.
#
# == Returns:
#
# The specified MeetingRelaySwimmer instance (which will result created only when successful).
# nil only in case of no-ops.
#
Creates a new row given its parent mrr id and its other values.
This method updates also the internal SQL diff log file.



The specified MeetingRelaySwimmer instance (which will result created only when successful).
nil only in case of no-ops.
Creates a new row given its parent mrr id and its other values . This method updates also the internal SQL diff log file . The specified MeetingRelaySwimmer instance ( which will result created only when successful ) . nil only in case of no - ops .
def create_new_row!( mrr, relay_order, swimmer_id, badge_id, stroke_type_id, timing_instance, reaction_time_instance )
    return nil unless swimmer_id.present? && badge_id.present? && relay_order.present?
    mrs = MeetingRelaySwimmer.new(
      meeting_relay_result_id: mrr.id,
      relay_order:    relay_order,
      swimmer_id:     swimmer_id,
      badge_id:       badge_id,
      minutes:        timing_instance ? timing_instance.minutes : 0,
      seconds:        timing_instance ? timing_instance.seconds : 0,
      hundreds:       timing_instance ? timing_instance.hundreds : 0,
      reaction_time:  reaction_time_instance ? reaction_time_instance.to_hundreds / 100.0 : 0.0,
      stroke_type_id: stroke_type_id,
      user_id:        @current_user.id
    )
    mrs.save!
    sql_diff_text_log << to_sql_insert( mrs, false, "\r\n" )
    mrs
  end
def create_new_row! ( mrr , relay_order , swimmer_id , badge_id , stroke_type_id , timing_instance , reaction_time_instance ) return nil unless swimmer_id . present? && badge_id . present? && relay_order . present? mrs = MeetingRelaySwimmer . new ( meeting_relay_result_id : mrr . id , relay_order : relay_order , swimmer_id : swimmer_id , badge_id : badge_id , minutes : timing_instance ? timing_instance . minutes : 0 , seconds : timing_instance ? timing_instance . seconds : 0 , hundreds : timing_instance ? timing_instance . hundreds : 0 , reaction_time : reaction_time_instance ? reaction_time_instance . to_hundreds / 100.0 : 0.0 , stroke_type_id : stroke_type_id , user_id : @current_user . id ) mrs . save! sql_diff_text_log << to_sql_insert ( mrs , false , "\r\n" ) mrs end
Creates a new row given its parent mrr id and its other values.
Creates a new row given its parent mrr id and its other values .
# DEBUG #    puts "before SAVE!" #    puts ValidationErrorTools.recursive_error_for( mrs ) unless mrs.valid? # Store Db-diff text for INSERT
mrr
relay_order
swimmer_id
badge_id
stroke_type_id
timing_instance
reaction_time_instance