Sha256: 55c0d82a155f4ebcf27113b8dc1890d89e0e299b5ff8c29a5f41a362f1852491

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

# encoding: UTF-8
require 'rails/generators/migration'
require 'rails/generators/active_record'

module Georgia
  module Generators
    class UpgradeGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration

      source_root File.expand_path('../templates', __FILE__)

      desc "Upgrades Georgia CMS to fit latest changes"

      def self.next_migration_number(number)
        ActiveRecord::Generators::Base.next_migration_number(number)
      end

      def run_migrations
        migration_template "add_public_to_georgia_pages.rb", "db/migrate/add_public_to_georgia_pages.rb"
        migration_template "add_state_to_georgia_pages.rb", "db/migrate/add_state_to_georgia_pages.rb"
        migration_template "add_anti_spam_to_messages.rb", "db/migrate/add_anti_spam_to_messages.rb"
        migration_template "create_georgia_revisions.rb", "db/migrate/create_georgia_revisions.rb"
        migration_template "add_contents_counter_cache_to_images.rb", "db/migrate/add_contents_counter_cache_to_images.rb"
        rake 'db:migrate'
      end

      def run_tasks
        rake 'georgia:statuses'
        rake 'georgia:revisions'
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
georgia-0.7.1 lib/generators/georgia/upgrade/upgrade_generator.rb
georgia-0.7.0 lib/generators/georgia/upgrade/upgrade_generator.rb