Class: SessionMigrationGenerator

Inherits:
Rails::Generator::NamedBase show all
Defined in:
lib/rails_generator/generators/components/session_migration/session_migration_generator.rb

Instance Attribute Summary

Attributes inherited from Rails::Generator::NamedBase

#class_name, #class_nesting, #class_nesting_depth, #class_path, #file_path, #name, #plural_name, #singular_name, #table_name

Attributes inherited from Rails::Generator::Base

#args, #destination_root, #source_root

Instance Method Summary collapse

Methods inherited from Rails::Generator::Base

#destination_path, #source_path

Constructor Details

#initialize(runtime_args, runtime_options = {}) ⇒ SessionMigrationGenerator

Returns a new instance of SessionMigrationGenerator.



2
3
4
5
# File 'lib/rails_generator/generators/components/session_migration/session_migration_generator.rb', line 2

def initialize(runtime_args, runtime_options = {})
  runtime_args << 'add_session_table' if runtime_args.empty?
  super
end

Instance Method Details

#manifestObject



7
8
9
10
11
12
# File 'lib/rails_generator/generators/components/session_migration/session_migration_generator.rb', line 7

def manifest
  record do |m|
    m.migration_template 'migration.rb', 'db/migrate',
      :assigns => { :session_table_name => default_session_table_name }
  end
end