Sha256: 9da83a9317999c47a00ecfc7b38b7f6636a81f92481066fc03ea66bb12b3abc1

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

require 'rails/generators'
require 'tramway/core/generators/install_generator'

module Tramway::Page::Generators
  class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
    include Rails::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)

    def run_other_generators
    end

    def self.next_migration_number(path)
      next_migration_number = current_migration_number(path) + 1
      ActiveRecord::Migration.next_migration_number next_migration_number
    end

    def copy_migrations
      migrations = [
        :create_tramway_page_pages,
        :add_view_to_tramway_page_pages
      ]
      migrations.each do |migration|
        migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-page-1.3 lib/tramway/page/generators/install_generator.rb