cirandas.net

ref: master

db/migrate/084_set_public_article_into_published_attribute.rb


1
2
3
4
5
6
7
8
9
class SetPublicArticleIntoPublishedAttribute < ActiveRecord::Migration
  def self.up
    execute('update articles set published=(1!=1) where not public_article')
  end

  def self.down
    say "this migration can't be reverted"
  end
end