class Correspondent::Generators::InstallGenerator

InstallGenerator

Creates the necessary migrations to be able to use the engine.

Public Class Methods

next_migration_number(_path) click to toggle source
# File lib/generators/correspondent/install/install_generator.rb, line 17
def self.next_migration_number(_path)
  if @prev_migration_nr
    @prev_migration_nr += 1
  else
    @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
  end

  @prev_migration_nr.to_s
end

Public Instance Methods

copy_migrations() click to toggle source
# File lib/generators/correspondent/install/install_generator.rb, line 27
def copy_migrations
  migration_template "create_correspondent_notifications.rb",
                     "db/migrate/create_correspondent_notifications.rb",
                     migration_version: migration_version
end
migration_version() click to toggle source
# File lib/generators/correspondent/install/install_generator.rb, line 33
def migration_version
  "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end