Sha256: 1e12dccf8d9f1d711152f196baaae1d65441a4abba43aefbfe304446b6103708

Contents?: true

Size: 358 Bytes

Versions: 10

Compression:

Stored size: 358 Bytes

Contents

class AddPublishedAsToPosts < ActiveRecord::Migration
  def self.up
    add_column :posts, :published_as, :string, :limit => 16, :default => 'draft'
    # update all existing posts
    # Nope: not here. Do it in a rake task if you want.
    # Post.update_all("published_as = 'live'")
  end

  def self.down
    remove_column :posts, :published_as
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
community_engine-3.2.0 db/migrate/054_add_published_as_to_posts.rb
community_engine-3.0.0 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.3.2 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.3.1 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.3.0 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.1.0 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.0.0 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.0.0.beta3 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.0.0.beta2 db/migrate/054_add_published_as_to_posts.rb
community_engine-2.0.0.beta1 db/migrate/054_add_published_as_to_posts.rb