class Vigilion::ScanGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/vigilion/scan/scan_generator.rb, line 10
def self.next_migration_number(path)
  Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Public Instance Methods

create_model_file() click to toggle source
# File lib/generators/vigilion/scan/scan_generator.rb, line 14
def create_model_file
  @table_name = model_name.tableize
  @column_name = "#{attribute_name}_scan_results"
  @migration_name = "vigilion_scan_#{@table_name}_#{attribute_name}"
  migration_template "add_scan_results_columns.rb.erb", "db/migrate/#{@migration_name}.rb"
end