app/strategies/relay_swimmer_updater.rb
# 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
<not_specific>
relay_order
<not_specific>
swimmer_id
<not_specific>
badge_id
<not_specific>
stroke_type_id
<not_specific>
timing_instance
<not_specific>
reaction_time_instance
<not_specific>