class GorgEngine::Generators::InstallGenerator

Protected Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/gorg_engine_generator.rb, line 20
def self.next_migration_number(path)
  @migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i.to_s
end

Public Instance Methods

copy_migrations() click to toggle source

# File lib/generators/gorg_engine_generator.rb, line 13
def copy_migrations
  copy_migration "init_gorg_engine"
end

Protected Instance Methods

copy_migration(filename) click to toggle source
# File lib/generators/gorg_engine_generator.rb, line 24
def copy_migration(filename)
  if self.class.migration_exists?("db/migrate", "#{filename}")
    say_status("skipped", "Migration #{filename}.rb already exists")
  else
    migration_template "migrations/#{filename}.rb", "db/migrate/#{filename}.rb"
    puts "#######################################"
    puts "You HAVE TO edit db/migrate/#{filename}.rb to avoid conflict with your current migration"
    puts "For each table and for each column : check if exist in your current project, and comment the line if needed."
  end
end