Sha256: 15801949e2f4be31022a8fdbb7fd98ee32bd7542f4ae6fa91aaaf82725500a71

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

class Messaging::InstallGenerator < Rails::Generators::Base #:nodoc:
  include Rails::Generators::Migration
  source_root File.expand_path('../templates', __FILE__)
  require 'rails/generators/migration'

  def self.next_migration_number path
    unless @prev_migration_nr
      @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
    else
      @prev_migration_nr += 1
    end
    @prev_migration_nr.to_s
  end

  def create_initializer_file
    template 'initializer.rb', 'config/initializers/messaging.rb'
  end

  def copy_migrations
    require 'rake'
    Rails.application.load_tasks
    Rake::Task['railties:install:migrations'].reenable
    Rake::Task['messaging_engine:install:migrations'].invoke
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
messaging-0.0.2 lib/generators/messaging/install_generator.rb