app/models/concerns/clean_up_methods.rb
def clean_time_tables
    time_tables = case date_type.to_sym
    when :before
      Chouette::TimeTable.where('end_date < ?', self.begin_date)
    when :after
      Chouette::TimeTable.where('start_date > ?', self.begin_date)
    when :outside
      Chouette::TimeTable.where('start_date > ? OR end_date < ?', self.end_date, self.begin_date)
    when :between
      Chouette::TimeTable.where('start_date > ? AND end_date < ?', self.begin_date, self.end_date)
    end

    time_tables.clean!
  end
# EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS SELECTED FROM THE UI
def clean_time_tables
    time_tables = case date_type.to_sym
    when :before
      Chouette::TimeTable.where('end_date < ?', self.begin_date)
    when :after
      Chouette::TimeTable.where('start_date > ?', self.begin_date)
    when :outside
      Chouette::TimeTable.where('start_date > ? OR end_date < ?', self.end_date, self.begin_date)
    when :between
      Chouette::TimeTable.where('start_date > ? AND end_date < ?', self.begin_date, self.end_date)
    end
    time_tables.clean!
  end
def clean_time_tables time_tables = case date_type . to_sym when :before Chouette :: TimeTable . where ( 'end_date < ?' , self . begin_date ) when :after Chouette :: TimeTable . where ( 'start_date > ?' , self . begin_date ) when :outside Chouette :: TimeTable . where ( 'start_date > ? OR end_date < ?' , self . end_date , self . begin_date ) when :between Chouette :: TimeTable . where ( 'start_date > ? AND end_date < ?' , self . begin_date , self . end_date ) end time_tables . clean! end
EXTRA CLEANINGS, SELECTED FROM THE UI
EXTRA CLEANINGS SELECTED FROM THE UI