AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: DynamoDb::Generators::SessionStoreMigrationGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/dynamo_db/session_store_migration/session_store_migration_generator.rb

Overview

Generates an ActiveRecord migration that creates and deletes a DynamoDB Session table.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(_dir = nil) ⇒ Object

Next migration number - must be implemented



34
35
36
# File 'lib/generators/dynamo_db/session_store_migration/session_store_migration_generator.rb', line 34

def self.next_migration_number(_dir = nil)
  Time.now.utc.strftime('%Y%m%d%H%M%S')
end

Instance Method Details

#copy_sample_config_fileObject



26
27
28
29
30
31
# File 'lib/generators/dynamo_db/session_store_migration/session_store_migration_generator.rb', line 26

def copy_sample_config_file
  template(
    'dynamo_db_session_store.yml',
    'config/dynamo_db_session_store.yml'
  )
end

#generate_migration_fileRails Migration File

Returns migration file for creation and deletion of a DynamoDB session table.

Returns:

  • (Rails Migration File)

    migration file for creation and deletion of a DynamoDB session table.



19
20
21
22
23
24
# File 'lib/generators/dynamo_db/session_store_migration/session_store_migration_generator.rb', line 19

def generate_migration_file
  migration_template(
    'session_store_migration.rb',
    "db/migrate/#{name.underscore}.rb"
  )
end