Sha256: 3e3fe25727688f23a3d856512d4c59029a5538f74d1efb6cf5bd1be4e6476145
Contents?: true
Size: 448 Bytes
Versions: 12
Compression:
Stored size: 448 Bytes
Contents
class MoveDateToAttendanceSheet < ActiveRecord::Migration[6.0] def up dates = Ecom::Core::CrewTime.pluck('DISTINCT date(date)') return if dates.count.zero? attendances = [] dates.each do |date| attendances << Ecom::Core::AttendanceSheet.new(date: date) end Ecom::Core::AttendanceSheet.transaction do attendances.each(&:save) end end def down raise ActiveRecord::IrreversibleMigration end end
Version data entries
12 entries across 12 versions & 1 rubygems