Sha256: 52976b37c6d7a83b30375912a981fac273e6984c426fbf25ff5fba1a4c110d20
Contents?: true
Size: 920 Bytes
Versions: 24
Compression:
Stored size: 920 Bytes
Contents
class MoveFeedbackToNewStateMachine < ActiveRecord::Migration class Content < ActiveRecord::Base include BareMigration end def self.up return if $schema_generator Content.find(:all, :conditions => ['type = ? or type = ?', 'Trackback', 'Comment']).each do |c| c.state = if c.published? 'ContentState::PresumedHam' else 'ContentState::PresumedSpam' end c.save! end end def self.down return if $schema_generator Content.find(:all, :conditions => ['type = ? or type = ?', 'Trackback', 'Comment']).each do |c| c.state = if c.published? 'ContentState::Published' else 'ContentState::Withdrawn' end c.save! end end end
Version data entries
24 entries across 24 versions & 1 rubygems