app/models/concerns/clean_up_methods.rb
# EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS SELECTED FROM THE UI
def clean_time_table_periods
    periods = Chouette::TimeTablePeriod
    periods = case date_type.to_sym
    when :before
      periods.where('period_end < ?', self.begin_date)
    when :after
      periods.where('period_start > ?', self.begin_date)
    when :outside
      periods.where('period_end < ? OR period_start > ?', self.begin_date, self.end_date)
    when :between
      periods.where('period_start >= ? AND period_end <= ?', self.begin_date, self.end_date)
    end
    periods.clean!
    truncate_time_table_periods
  end
def clean_time_table_periods periods = Chouette :: TimeTablePeriod periods = case date_type . to_sym when :before periods . where ( 'period_end < ?' , self . begin_date ) when :after periods . where ( 'period_start > ?' , self . begin_date ) when :outside periods . where ( 'period_end < ? OR period_start > ?' , self . begin_date , self . end_date ) when :between periods . where ( 'period_start >= ? AND period_end <= ?' , self . begin_date , self . end_date ) end periods . clean! truncate_time_table_periods end
EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS SELECTED FROM THE UI