Sha256: 394feda059e4e013be23aedf411e2359bbd7c3f4626b1ef8436f6e6595eb463c

Contents?: true

Size: 662 Bytes

Versions: 9

Compression:

Stored size: 662 Bytes

Contents

class AddProxifyToMailinglistClasses < ActiveRecord::Migration
    class MailinglistClass < ActiveRecord::Base; end

    def self.up
        add_column :mailinglist_classes, :proxify, :boolean, 
            :default => false


        MailinglistClass.find_all.each do |mailinglist_class|
            mailinglist_class.proxify = false;
            mailinglist_class.save
        end

        # execute "alter table mailinglist_classes alter proxify set not null"

        ml=MailinglistClass.find_by_name("LTMA")
        if ml
            ml.proxify = true
        end
    end

    def self.down
        remove_column  :mailinglist_classes, :proxify
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sugoi-mail-0.1.5 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.0.5 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.0.2 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.0.1 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.0.0 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.0.3 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.1.0 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.3.2 db/migrate/025_add_proxify_to_mailinglist_classes.rb
sugoi-mail-0.3.0 db/migrate/025_add_proxify_to_mailinglist_classes.rb