metasploit_data_models 3.0.10 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -1
- data/.travis.yml +1 -1
- data/Gemfile +6 -4
- data/Rakefile +1 -1
- data/app/models/mdm/api_key.rb +1 -1
- data/app/models/mdm/async_callback.rb +1 -1
- data/app/models/mdm/client.rb +1 -1
- data/app/models/mdm/cred.rb +1 -1
- data/app/models/mdm/event.rb +1 -1
- data/app/models/mdm/exploit_attempt.rb +1 -1
- data/app/models/mdm/exploited_host.rb +1 -1
- data/app/models/mdm/host.rb +2 -2
- data/app/models/mdm/host_detail.rb +2 -2
- data/app/models/mdm/host_tag.rb +1 -1
- data/app/models/mdm/listener.rb +1 -1
- data/app/models/mdm/loot.rb +1 -1
- data/app/models/mdm/macro.rb +1 -1
- data/app/models/mdm/mod_ref.rb +1 -1
- data/app/models/mdm/module/action.rb +1 -1
- data/app/models/mdm/module/arch.rb +1 -1
- data/app/models/mdm/module/author.rb +1 -1
- data/app/models/mdm/module/detail.rb +1 -1
- data/app/models/mdm/module/mixin.rb +1 -1
- data/app/models/mdm/module/platform.rb +1 -1
- data/app/models/mdm/module/ref.rb +1 -1
- data/app/models/mdm/module/target.rb +1 -1
- data/app/models/mdm/nexpose_console.rb +1 -1
- data/app/models/mdm/note.rb +1 -1
- data/app/models/mdm/payload.rb +1 -1
- data/app/models/mdm/profile.rb +1 -1
- data/app/models/mdm/ref.rb +1 -1
- data/app/models/mdm/route.rb +1 -1
- data/app/models/mdm/service.rb +2 -2
- data/app/models/mdm/session.rb +1 -1
- data/app/models/mdm/session_event.rb +1 -1
- data/app/models/mdm/tag.rb +1 -1
- data/app/models/mdm/task.rb +1 -1
- data/app/models/mdm/task_cred.rb +1 -1
- data/app/models/mdm/task_host.rb +1 -1
- data/app/models/mdm/task_service.rb +1 -1
- data/app/models/mdm/task_session.rb +1 -1
- data/app/models/mdm/user.rb +2 -2
- data/app/models/mdm/vuln.rb +2 -2
- data/app/models/mdm/vuln_attempt.rb +1 -1
- data/app/models/mdm/vuln_detail.rb +1 -1
- data/app/models/mdm/vuln_ref.rb +1 -1
- data/app/models/mdm/web_form.rb +1 -1
- data/app/models/mdm/web_page.rb +1 -1
- data/app/models/mdm/web_site.rb +1 -1
- data/app/models/mdm/web_vuln.rb +1 -1
- data/app/models/mdm/wmap_request.rb +1 -1
- data/app/models/mdm/wmap_target.rb +1 -1
- data/app/models/mdm/workspace.rb +6 -6
- data/app/models/metasploit_data_models/automatic_exploitation/match.rb +1 -1
- data/app/models/metasploit_data_models/automatic_exploitation/match_result.rb +1 -1
- data/app/models/metasploit_data_models/automatic_exploitation/match_set.rb +1 -1
- data/app/models/metasploit_data_models/automatic_exploitation/run.rb +2 -2
- data/app/models/metasploit_data_models/module_run.rb +1 -1
- data/bin/rails +14 -0
- data/config/initializers/arel_helper.rb +2 -2
- data/config/initializers/ipaddr.rb +11 -6
- data/db/migrate/000_create_tables.rb +1 -1
- data/db/migrate/001_add_wmap_tables.rb +1 -1
- data/db/migrate/002_add_workspaces.rb +1 -1
- data/db/migrate/003_move_notes.rb +1 -1
- data/db/migrate/004_add_events_table.rb +1 -1
- data/db/migrate/005_expand_info.rb +1 -1
- data/db/migrate/006_add_timestamps.rb +1 -1
- data/db/migrate/007_add_loots.rb +1 -1
- data/db/migrate/008_create_users.rb +1 -1
- data/db/migrate/009_add_loots_ctype.rb +1 -1
- data/db/migrate/010_add_alert_fields.rb +1 -1
- data/db/migrate/011_add_reports.rb +1 -1
- data/db/migrate/012_add_tasks.rb +1 -1
- data/db/migrate/013_add_tasks_result.rb +1 -1
- data/db/migrate/014_add_loots_fields.rb +1 -1
- data/db/migrate/015_rename_user.rb +1 -1
- data/db/migrate/016_add_host_purpose.rb +1 -1
- data/db/migrate/017_expand_info2.rb +1 -1
- data/db/migrate/018_add_workspace_user_info.rb +1 -1
- data/db/migrate/019_add_workspace_desc.rb +1 -1
- data/db/migrate/020_add_user_preferences.rb +1 -1
- data/db/migrate/021_standardize_info_and_data.rb +1 -1
- data/db/migrate/022_enlarge_event_info.rb +1 -1
- data/db/migrate/023_add_report_downloaded_at.rb +1 -1
- data/db/migrate/024_convert_service_info_to_text.rb +1 -1
- data/db/migrate/025_add_user_admin.rb +1 -1
- data/db/migrate/026_add_creds_table.rb +1 -1
- data/db/migrate/20100819123300_migrate_cred_data.rb +1 -1
- data/db/migrate/20100824151500_add_exploited_table.rb +1 -1
- data/db/migrate/20100908001428_add_owner_to_workspaces.rb +1 -1
- data/db/migrate/20100911122000_add_report_templates.rb +1 -1
- data/db/migrate/20100916151530_require_admin_flag.rb +1 -1
- data/db/migrate/20100916175000_add_campaigns_and_templates.rb +1 -1
- data/db/migrate/20100920012100_add_generate_exe_column.rb +1 -1
- data/db/migrate/20100926214000_add_template_prefs.rb +1 -1
- data/db/migrate/20101001000000_add_web_tables.rb +1 -1
- data/db/migrate/20101002000000_add_query.rb +1 -1
- data/db/migrate/20101007000000_add_vuln_info.rb +1 -1
- data/db/migrate/20101008111800_add_clients_to_campaigns.rb +1 -1
- data/db/migrate/20101009023300_add_campaign_attachments.rb +1 -1
- data/db/migrate/20101104135100_add_imported_creds.rb +1 -1
- data/db/migrate/20101203000000_fix_web_tables.rb +1 -1
- data/db/migrate/20101203000001_expand_host_comment.rb +1 -1
- data/db/migrate/20101206212033_add_limit_to_network_to_workspaces.rb +1 -1
- data/db/migrate/20110112154300_add_module_uuid_to_tasks.rb +1 -1
- data/db/migrate/20110204112800_add_host_tags.rb +1 -1
- data/db/migrate/20110317144932_add_session_table.rb +4 -4
- data/db/migrate/20110414180600_add_local_id_to_session_table.rb +1 -1
- data/db/migrate/20110415175705_add_routes_table.rb +1 -1
- data/db/migrate/20110422000000_convert_binary.rb +3 -3
- data/db/migrate/20110425095900_add_last_seen_to_sessions.rb +1 -1
- data/db/migrate/20110513143900_track_successful_exploits.rb +3 -3
- data/db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb +2 -2
- data/db/migrate/20110527000000_add_task_id_to_reports_table.rb +1 -1
- data/db/migrate/20110527000001_add_api_keys_table.rb +1 -1
- data/db/migrate/20110606000001_add_macros_table.rb +1 -1
- data/db/migrate/20110622000000_add_settings_to_tasks_table.rb +1 -1
- data/db/migrate/20110624000001_add_listeners_table.rb +1 -1
- data/db/migrate/20110625000001_add_macro_to_listeners_table.rb +1 -1
- data/db/migrate/20110630000001_add_nexpose_consoles_table.rb +1 -1
- data/db/migrate/20110630000002_add_name_to_nexpose_consoles_table.rb +1 -1
- data/db/migrate/20110717000001_add_profiles_table.rb +1 -1
- data/db/migrate/20110727163801_expand_cred_ptype_column.rb +1 -1
- data/db/migrate/20110730000001_add_initial_indexes.rb +1 -1
- data/db/migrate/20110812000001_prune_indexes.rb +1 -1
- data/db/migrate/20110922000000_expand_notes.rb +1 -1
- data/db/migrate/20110928101300_add_mod_ref_table.rb +1 -1
- data/db/migrate/20111011110000_add_display_name_to_reports_table.rb +2 -2
- data/db/migrate/20111203000000_inet_columns.rb +1 -1
- data/db/migrate/20111204000000_more_inet_columns.rb +1 -1
- data/db/migrate/20111210000000_add_scope_to_hosts.rb +1 -1
- data/db/migrate/20120126110000_add_virtual_host_to_hosts.rb +1 -1
- data/db/migrate/20120411173220_rename_workspace_members.rb +1 -1
- data/db/migrate/20120601152442_add_counter_caches_to_hosts.rb +2 -2
- data/db/migrate/20120625000000_add_vuln_details.rb +1 -1
- data/db/migrate/20120625000001_add_host_details.rb +1 -1
- data/db/migrate/20120625000002_expand_details.rb +1 -1
- data/db/migrate/20120625000003_expand_details2.rb +1 -1
- data/db/migrate/20120625000004_add_vuln_attempts.rb +1 -1
- data/db/migrate/20120625000005_add_vuln_and_host_counter_caches.rb +1 -1
- data/db/migrate/20120625000006_add_module_details.rb +1 -1
- data/db/migrate/20120625000007_add_exploit_attempts.rb +1 -1
- data/db/migrate/20120625000008_add_fail_message.rb +1 -1
- data/db/migrate/20120718202805_add_owner_and_payload_to_web_vulns.rb +1 -1
- data/db/migrate/20130412154159_change_foreign_key_in_module_actions.rb +1 -1
- data/db/migrate/20130412171844_change_foreign_key_in_module_archs.rb +1 -1
- data/db/migrate/20130412173121_change_foreign_key_in_module_authors.rb +1 -1
- data/db/migrate/20130412173640_change_foreign_key_in_module_mixins.rb +1 -1
- data/db/migrate/20130412174254_change_foreign_key_in_module_platforms.rb +1 -1
- data/db/migrate/20130412174719_change_foreign_key_in_module_refs.rb +1 -1
- data/db/migrate/20130412175040_change_foreign_key_in_module_targets.rb +1 -1
- data/db/migrate/20130423211152_add_creds_counter_cache.rb +1 -1
- data/db/migrate/20130430162145_enforce_address_uniqueness_in_workspace_in_hosts.rb +6 -6
- data/db/migrate/20130510021637_remove_campaigns.rb +1 -1
- data/db/migrate/20130515164311_change_web_vulns_confidence_to_integer.rb +1 -1
- data/db/migrate/20130515172727_valid_mdm_web_vuln_params.rb +1 -1
- data/db/migrate/20130516204810_making_vulns_refs_a_real_ar_model.rb +2 -2
- data/db/migrate/20130522001343_create_task_creds.rb +1 -1
- data/db/migrate/20130522032517_create_task_hosts.rb +1 -1
- data/db/migrate/20130522041110_create_task_services.rb +1 -1
- data/db/migrate/20130525015035_remove_campaign_id_from_clients.rb +1 -1
- data/db/migrate/20130525212420_drop_table_imported_creds.rb +1 -1
- data/db/migrate/20130531144949_making_host_tags_a_real_ar_model.rb +1 -1
- data/db/migrate/20130604145732_create_task_sessions.rb +1 -1
- data/db/migrate/20130717150737_remove_pname_validation.rb +1 -1
- data/db/migrate/20131002004641_create_automatic_exploitation_matches.rb +1 -1
- data/db/migrate/20131002164449_create_automatic_exploitation_match_sets.rb +1 -1
- data/db/migrate/20131008213344_create_automatic_exploitation_runs.rb +1 -1
- data/db/migrate/20131011184338_module_detail_on_automatic_exploitation_match.rb +1 -1
- data/db/migrate/20131017150735_create_automatic_exploitation_match_results.rb +1 -1
- data/db/migrate/20131021185657_make_match_polymorphic.rb +1 -1
- data/db/migrate/20140905031549_add_detected_arch_to_host.rb +1 -1
- data/db/migrate/20150112203945_remove_duplicate_services.rb +1 -1
- data/db/migrate/20150205192745_drop_service_uniqueness_index.rb +1 -1
- data/db/migrate/20150209195939_add_vuln_id_to_note.rb +1 -1
- data/db/migrate/20150212214222_remove_duplicate_services2.rb +1 -1
- data/db/migrate/20150219173821_create_module_runs.rb +1 -1
- data/db/migrate/20150219215039_add_module_run_to_session.rb +1 -1
- data/db/migrate/20150226151459_add_module_run_fk_to_loot.rb +1 -1
- data/db/migrate/20150312155312_add_module_full_name_to_match.rb +1 -1
- data/db/migrate/20150317145455_rename_module_indices.rb +2 -2
- data/db/migrate/20150326183742_add_missing_ae_indices.rb +1 -1
- data/db/migrate/20150421211719_rename_automatic_exploitation_index.rb +3 -3
- data/db/migrate/20150514182921_add_origin_to_mdm_vuln.rb +1 -1
- data/db/migrate/20160415153312_remove_not_null_from_web_vuln_p_arams.rb +1 -1
- data/db/migrate/20161004165612_add_fingerprinted_to_workspace.rb +1 -1
- data/db/migrate/20161227212223_add_os_family_to_hosts.rb +1 -1
- data/db/migrate/20180904120211_create_payloads.rb +1 -1
- data/db/migrate/20190308134512_create_async_callbacks.rb +1 -1
- data/db/migrate/20190507120211_remove_payload_workspaces.rb +1 -1
- data/lib/metasploit_data_models.rb +0 -1
- data/lib/metasploit_data_models/automatic_exploitation.rb +1 -1
- data/lib/metasploit_data_models/base64_serializer.rb +1 -1
- data/lib/metasploit_data_models/change_required_columns_to_null_false.rb +2 -2
- data/lib/metasploit_data_models/engine.rb +1 -1
- data/lib/metasploit_data_models/version.rb +1 -1
- data/metasploit_data_models.gemspec +4 -8
- data/spec/app/models/mdm/exploit_attempt_spec.rb +2 -2
- data/spec/app/models/mdm/host_detail_spec.rb +1 -1
- data/spec/app/models/mdm/module/detail_spec.rb +18 -18
- data/spec/app/models/mdm/service_spec.rb +1 -0
- data/spec/app/models/mdm/vuln_attempt_spec.rb +1 -1
- data/spec/app/models/mdm/vuln_detail_spec.rb +1 -1
- data/spec/app/models/mdm/vuln_spec.rb +1 -1
- data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +4 -4
- data/spec/dummy/app/assets/config/manifest.js +1 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/db/structure.sql +213 -329
- metadata +89 -98
- metadata.gz.sig +1 -3
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_actions.module_detail_id` to `module_actions.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleActions < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleActions < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_archs.module_detail_id` to `module_archs.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleArchs < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleArchs < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_authors.module_detail_id` to `module_authors.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleAuthors < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleAuthors < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_mixins.module_detail_id` to `module_mixins.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleMixins < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleMixins < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_platforms.module_detail_id` to `module_platforms.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModulePlatforms < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModulePlatforms < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_refs.module_detail_id` to `module_refs.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleRefs < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleRefs < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes `module_targets.module_detail_id` to `module_targets.detail_id` so that foreign key matches the conventional
|
2
2
|
# name when `Mdm::ModuleDetail` became {Mdm::Module::Detail}.
|
3
|
-
class ChangeForeignKeyInModuleTargets < ActiveRecord::Migration
|
3
|
+
class ChangeForeignKeyInModuleTargets < ActiveRecord::Migration[4.2]
|
4
4
|
#
|
5
5
|
# CONSTANTS
|
6
6
|
#
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Changes index on address so it scoped to workspace_id and is unique to match the validation in {Mdm::Host} on
|
2
2
|
# {Mdm::Host#address}.
|
3
|
-
class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration
|
3
|
+
class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration[4.2]
|
4
4
|
TABLE_NAME = :hosts
|
5
5
|
|
6
6
|
# maps Table -> Association Column for models that "belong to" a Host
|
@@ -33,7 +33,7 @@ class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration
|
|
33
33
|
# idea what version of the code the user has checked out. So we fall back to SQL :(
|
34
34
|
def find_and_merge_duplicate_hosts!
|
35
35
|
# find all duplicate addresses within the same workspace currently in the db
|
36
|
-
dupe_addresses_and_workspaces =
|
36
|
+
dupe_addresses_and_workspaces = ApplicationRecord.connection.execute(%Q{
|
37
37
|
SELECT workspace_id, address, count_addr
|
38
38
|
FROM (
|
39
39
|
SELECT workspace_id, address, COUNT(address) AS count_addr
|
@@ -49,10 +49,10 @@ class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration
|
|
49
49
|
# iterate through the duped IPs
|
50
50
|
dupe_addresses_and_workspaces.each do |result|
|
51
51
|
# so its come to this
|
52
|
-
address =
|
52
|
+
address = ApplicationRecord.connection.quote(result['address'])
|
53
53
|
workspace_id = result['workspace_id'].to_i
|
54
54
|
# look up the duplicate Host table entries to find all IDs of the duped Hosts
|
55
|
-
hosts =
|
55
|
+
hosts = ApplicationRecord.connection.execute(%Q|
|
56
56
|
SELECT id
|
57
57
|
FROM hosts
|
58
58
|
WHERE address=#{address} AND workspace_id=#{workspace_id}
|
@@ -65,13 +65,13 @@ class EnforceAddressUniquenessInWorkspaceInHosts < ActiveRecord::Migration
|
|
65
65
|
dupe_host_ids = hosts[1..-1]
|
66
66
|
# update associations to these duplicate Hosts
|
67
67
|
HOST_ASSOCIATION_MAP.each do |table, column|
|
68
|
-
|
68
|
+
ApplicationRecord.connection.execute(%Q|
|
69
69
|
UPDATE #{table} SET #{column}=#{first_host_id}
|
70
70
|
WHERE #{column} IN (#{dupe_host_ids.join(',')})
|
71
71
|
|)
|
72
72
|
end
|
73
73
|
# destroy the duplicate host rows
|
74
|
-
|
74
|
+
ApplicationRecord.connection.execute(%Q|
|
75
75
|
DELETE FROM hosts WHERE id IN (#{dupe_host_ids.join(',')})
|
76
76
|
|)
|
77
77
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class ModuleDetailOnAutomaticExploitationMatch < ActiveRecord::Migration
|
1
|
+
class ModuleDetailOnAutomaticExploitationMatch < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
3
|
rename_column :automatic_exploitation_matches, :ref_id, :module_detail_id
|
4
4
|
add_column :automatic_exploitation_matches, :match_set_id, :integer
|
@@ -1,8 +1,8 @@
|
|
1
|
-
class RenameModuleIndices < ActiveRecord::Migration
|
1
|
+
class RenameModuleIndices < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
# This migration will only need to be run if the indices were originally
|
4
4
|
# generated before Rails 4. Fresh builds can safely skip this.
|
5
|
-
return if
|
5
|
+
return if ApplicationRecord.connection.indexes(:module_actions).first.name != 'index_module_actions_on_module_detail_id'
|
6
6
|
|
7
7
|
rename_index :module_actions,
|
8
8
|
'index_module_actions_on_module_detail_id',
|
@@ -1,13 +1,13 @@
|
|
1
|
-
class RenameAutomaticExploitationIndex < ActiveRecord::Migration
|
1
|
+
class RenameAutomaticExploitationIndex < ActiveRecord::Migration[4.2]
|
2
2
|
def up
|
3
|
-
if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_ref_id
|
3
|
+
if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_ref_id
|
4
4
|
rename_index :automatic_exploitation_matches,
|
5
5
|
:index_automatic_exploitation_matches_on_ref_id,
|
6
6
|
:index_automatic_exploitation_matches_on_module_detail_id
|
7
7
|
end
|
8
8
|
end
|
9
9
|
def down
|
10
|
-
if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_module_detail_id
|
10
|
+
if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_module_detail_id
|
11
11
|
rename_index :automatic_exploitation_matches,
|
12
12
|
:index_automatic_exploitation_matches_on_module_detail_id,
|
13
13
|
:index_automatic_exploitation_matches_on_ref_id
|
@@ -16,7 +16,7 @@ module MetasploitDataModels::AutomaticExploitation
|
|
16
16
|
# Module Methods
|
17
17
|
#
|
18
18
|
|
19
|
-
# The prefix of the `
|
19
|
+
# The prefix of the `ApplicationRecord#table_name` of subclasses in this namespace.
|
20
20
|
#
|
21
21
|
# @return [String]
|
22
22
|
def self.table_name_prefix
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Provides ActiveRecord 3.1x-friendly serialization for descendants of
|
2
|
-
#
|
2
|
+
# ApplicationRecord. Backwards compatible with older YAML methods and
|
3
3
|
# will fall back to string decoding in the worst case
|
4
4
|
#
|
5
5
|
# @example Using default default of {}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# `:null => true`, to `:null => false`.
|
3
3
|
#
|
4
4
|
# @abstract Subclass and define COLUMNS as Array<Symbol> and TABLE_NAME as Symbol.
|
5
|
-
class MetasploitDataModels::ChangeRequiredColumnsToNullFalse < ActiveRecord::Migration
|
5
|
+
class MetasploitDataModels::ChangeRequiredColumnsToNullFalse < ActiveRecord::Migration[4.2]
|
6
6
|
# Marks all the COLUMNS as `:null => true`
|
7
7
|
def down
|
8
8
|
# Use self.class:: so constants are resolved in subclasses instead of this class.
|
@@ -18,4 +18,4 @@ class MetasploitDataModels::ChangeRequiredColumnsToNullFalse < ActiveRecord::Mig
|
|
18
18
|
change_column_null(self.class::TABLE_NAME, column, false)
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|