Class: ActiveOutboxGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Includes:
ActiveOutbox::AdapterHelper
Defined in:
lib/active_outbox/generators/active_outbox_generator.rb

Instance Method Summary collapse

Methods included from ActiveOutbox::AdapterHelper

json_type, postgres?, uuid_type

Instance Method Details

#create_migration_filesObject



13
14
15
16
17
18
19
20
# File 'lib/active_outbox/generators/active_outbox_generator.rb', line 13

def create_migration_files
  migration_path = "#{options['root_components_path']}/db/migrate"
  migration_template(
    'migration.rb',
    "#{migration_path}/outbox_create_#{table_name}.rb",
    migration_version: migration_version
  )
end

#migration_versionObject



22
23
24
# File 'lib/active_outbox/generators/active_outbox_generator.rb', line 22

def migration_version
  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end

#table_nameObject



26
27
28
# File 'lib/active_outbox/generators/active_outbox_generator.rb', line 26

def table_name
  "#{name}_outboxes"
end