Class: Pgq::PgqGenerator

Inherits:
Rails::Generator::NamedBase
  • Object
show all
Defined in:
lib/generators/pgq/pgq_generator.rb

Instance Method Summary collapse

Instance Method Details

#manifestObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/pgq/pgq_generator.rb', line 7

def manifest
  record do |m|
    m.template "pgq_class.rb", "app/workers/pgq_#{file_path}.rb"
    m.directory "spec/workers"
    m.template "spec.rb", "spec/workers/pgq_#{file_path}_spec.rb"
    m.template "migration.rb", "db/migrate/#{Time.now.utc.strftime("%Y%m%d%H%M%S")}_create_#{file_path}_queue.rb"
    
    add_to_queues_list
  end
end