app/models/chouette/time_table.rb
def merge!(another_tt)
      transaction do
        days = [].tap do |array|
          array.push(*self.effective_days, *another_tt.effective_days)
          array.uniq!
        end

        self.dates.clear
        self.periods.clear

        days.each do |day|
          self.dates << Chouette::TimeTableDate.new(date: day, in_out: true)
        end
        self.save!
      end
      self.convert_continuous_dates_to_periods
    end
# merge effective days from another timetable
merge effective days from another timetable
merge effective days from another timetable
def merge!(another_tt)
      transaction do
        days = [].tap do |array|
          array.push(*self.effective_days, *another_tt.effective_days)
          array.uniq!
        end
        self.dates.clear
        self.periods.clear
        days.each do |day|
          self.dates << Chouette::TimeTableDate.new(date: day, in_out: true)
        end
        self.save!
      end
      self.convert_continuous_dates_to_periods
    end
def merge! ( another_tt ) transaction do days = [ ] . tap do | array | array . push ( * self . effective_days , * another_tt . effective_days ) array . uniq! end self . dates . clear self . periods . clear days . each do | day | self . dates << Chouette :: TimeTableDate . new ( date : day , in_out : true ) end self . save! end self . convert_continuous_dates_to_periods end
merge effective days from another timetable
merge effective days from another timetable
another_tt