Sha256: 0351e9a68540bb44195fccb4c955062b68f1fdf853219fd2b1876f20371f5332
Contents?: true
Size: 754 Bytes
Versions: 38
Compression:
Stored size: 754 Bytes
Contents
class LinkserGroupTitleAndDescriptionInActivityObject < ActiveRecord::Migration def up ao_ts = ActivityObject.record_timestamps ActivityObject.record_timestamps = false # Fix 'links' table l_ts = Link.record_timestamps Link.record_timestamps = false Link.all.each do |l| l.activity_object.title = l.read_attribute(:title) l.activity_object.description = l.read_attribute(:description) l.save! end change_table :links do |t| t.remove :title t.remove :description end Link.reset_column_information Link.record_timestamps = l_ts ActivityObject.record_timestamps = ao_ts end def down raise ActiveRecord::IrreversibleMigration # Due to trans-gem oddities end end
Version data entries
38 entries across 38 versions & 2 rubygems