Class: ArchiveStorage::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/generators/archive_storage/install_generator.rb', line 20

def self.next_migration_number(dirname)
  if ::ActiveRecord::Base.timestamped_migrations
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Instance Method Details

#copy_migrationObject



13
14
15
16
17
18
# File 'lib/generators/archive_storage/install_generator.rb', line 13

def copy_migration
  migration_template(
    "create_archive_storage_files.rb",
    "db/migrate/create_archive_storage_files.rb"
  )
end