Sha256: 7473aba8259499cc7b8f06be22bbf2d8b0a959ac341f8e8065931edb278a6236
Contents?: true
Size: 661 Bytes
Versions: 45
Compression:
Stored size: 661 Bytes
Contents
class EventsGroupTitleAndDescriptionInActivityObject < ActiveRecord::Migration def up ao_ts = ActivityObject.record_timestamps ActivityObject.record_timestamps = false # Fix 'events' table e_ts = Event.record_timestamps Event.record_timestamps = false Event.all.each do |e| e.activity_object.title = e.read_attribute(:title) e.save! end change_table :events do |t| t.remove :title end Event.reset_column_information Event.record_timestamps = e_ts ActivityObject.record_timestamps = ao_ts end def down raise ActiveRecord::IrreversibleMigration # Due to trans-gem oddities end end
Version data entries
45 entries across 45 versions & 2 rubygems