Sha256: d6452cc807c71714aac6709df58c4af125c47dad5d5dbf58aa1344abb3f4644c
Contents?: true
Size: 401 Bytes
Versions: 10
Compression:
Stored size: 401 Bytes
Contents
class AddPublishedAtToPosts < ActiveRecord::Migration def self.up add_column :posts, :published_at, :datetime # Update all existing published posts # Set published_at to created_at date for posts that were already published # Nope. # Post.update_all("published_at = created_at", "published_as = 'live'") end def self.down remove_column :posts, :published_at end end
Version data entries
10 entries across 10 versions & 1 rubygems