Sha256: 55b8fe4e7930333a43a694f543e4a2674607221848e386fce8fa990fcb564b07

Contents?: true

Size: 423 Bytes

Versions: 6

Compression:

Stored size: 423 Bytes

Contents

class CreateDefaultImpacts < ActiveRecord::Migration
  
  IMPACT_DEFAULTS = %w[NONE PARTIAL COMPLETE]
  
  def self.up
    IMPACT_DEFAULTS.each do |name|
      FIDIUS::CveDb::Impact.find_or_create_by_name(name)
    end
  end

  def self.down
    IMPACT_DEFAULTS.each do |name|
      impacts = FIDIUS::CveDb::Impact.where({ :name => name })
      impacts.each do |impact|
        impact.destroy!
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fidius-cvedb-0.0.8 lib/db/migrate/20101122145008_create_default_impacts.rb
fidius-cvedb-0.0.7 lib/db/migrate/20101122145008_create_default_impacts.rb
fidius-cvedb-0.0.6 lib/db/migrate/20101122145008_create_default_impacts.rb
fidius-cvedb-0.0.5 lib/db/migrate/20101122145008_create_default_impacts.rb
fidius-cvedb-0.0.3 lib/db/migrate/20101122145008_create_default_impacts.rb
fidius-cvedb-0.0.2 lib/db/migrate/20101122145008_create_default_impacts.rb