app/models/stream.rb
# Returns the DefaultStreamHistory object for self.stream
# with a start_time and end_time between the supplied datetime.
Returns the DefaultStreamHistory object for self.stream
with a start_time and end_time between the supplied datetime.
Returns the DefaultStreamHistory object for self . stream with a start_time and end_time between the supplied datetime .
def select_default_stream_history_by_date(datetime)
    default_stream_histories.order(start_time: :desc)
                            .where('start_time <= ? AND ((end_time >= ?) OR (end_time IS ?))',
                                   Time.zone.parse(datetime),
                                   Time.zone.parse(datetime),
                                   nil).first
  end
def select_default_stream_history_by_date ( datetime ) default_stream_histories . order ( start_time : :desc ) . where ( 'start_time <= ? AND ((end_time >= ?) OR (end_time IS ?))' , Time . zone . parse ( datetime ) , Time . zone . parse ( datetime ) , nil ) . first end
Returns the DefaultStreamHistory object for self.stream
with a start_time and end_time between the supplied datetime.
Returns the DefaultStreamHistory object for self . stream with a start_time and end_time between the supplied datetime .
datetime
<not_specific>