Sha256: 9732205e7e78af5099945134458490060c580a365423c5c3a70602b04ca70712

Contents?: true

Size: 325 Bytes

Versions: 58

Compression:

Stored size: 325 Bytes

Contents

class MessageSentDate < ActiveRecord::Migration
  def self.up
    add_column :messages, :sent_at, :datetime
    Message.reset_column_information
    Message.all.each { |message| message.sent_at = message.updated_at || message.created_at; message.save! }
  end

  def self.down
    remove_column :messages, :sent_at
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
radiant-reader-extension-1.3.10 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.9 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.8 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.7 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.6 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.4 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.3 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.1 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.3.0 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.2.4 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.2.3 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.2.2 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.2.1 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.2.0 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.1.1 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.1.0 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.0.1 db/migrate/20101019094714_message_sent_date.rb
radiant-reader-extension-1.0.0 db/migrate/20101019094714_message_sent_date.rb