Class: ActiveAgent::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_agent/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/generators/active_agent/install/install_generator.rb', line 13

def self.next_migration_number(path)
  next_num = Time.now.utc.strftime("%Y%m%d%H%M%S")
  begin
    ActiveRecord::Generators::Base.next_migration_number(path)
  rescue StandardError
    next_num
  end
end

Instance Method Details

#create_initializerObject



22
23
24
# File 'lib/generators/active_agent/install/install_generator.rb', line 22

def create_initializer
  template "active_agent.rb", "config/initializers/active_agent.rb"
end

#create_migration_fileObject



26
27
28
# File 'lib/generators/active_agent/install/install_generator.rb', line 26

def create_migration_file
  migration_template "create_active_agent_messages.rb", "db/migrate/create_active_agent_messages.rb"
end