Module: MetasploitDataModels

Extended by:
Models
Defined in:
lib/metasploit_data_models/base64_serializer.rb,
lib/metasploit_data_models.rb,
lib/metasploit_data_models/engine.rb,
lib/metasploit_data_models/models.rb,
lib/metasploit_data_models/version.rb,
lib/metasploit_data_models/validators.rb,
lib/metasploit_data_models/serialized_prefs.rb,
lib/metasploit_data_models/change_required_columns_to_null_false.rb

Overview

Provides ActiveRecord 3.1x-friendly serialization for descendants of ActiveRecord::Base. Backwards compatible with older YAML methods and will fall back to string decoding in the worst case

Examples:

Using default default of {}

serialize :foo, MetasploitDataModels::Base64Serializer.new

Overriding default to []

serialize :bar, MetasploitDataModels::Base64Serializer.new(:default => [])

Defined Under Namespace

Modules: Models, SerializedPrefs, Validators Classes: Base64Serializer, ChangeRequiredColumnsToNullFalse, Engine

Constant Summary collapse

VERSION =

MetasploitDataModels follows the Semantic Versioning Specification. At this time, the API is considered unstable because although the database migrations have moved from metasploit-framework/data/sql/migrate to db/migrate in this project, not all models have specs that verify the migrations (with have_db_column and have_db_index) and certain models may not be shared between metasploit-framework and pro, so models may be removed in the future. Because of the unstable API the version should remain below 1.0.0

'0.16.1'

Class Method Summary collapse

Methods included from Models

models_pathname, require_models

Methods included from Validators

#autoload_validators, #validators_pathname

Class Method Details

.app_pathnameObject



33
34
35
# File 'lib/metasploit_data_models.rb', line 33

def self.app_pathname
  root.join('app')
end

.rootObject



37
38
39
40
41
42
43
44
45
# File 'lib/metasploit_data_models.rb', line 37

def self.root
  unless instance_variable_defined? :@root
    lib_pathname = Pathname.new(__FILE__).dirname

    @root = lib_pathname.parent
  end

  @root
end