rapid7/metasploit_data_models — pull request #4 by limhoff-r7 (2012-10-17 20:36:16+00:00)
Title: Make metasploit_data_models a Rails Engine

[#37858565]

If Rails is defined when metasploit_data_models is required, then
metasploit_data_models/engine will be required, and
metasploit_data_models will function as a Rails::Engine. This means the
autoload paths to things like app/models will just work.

Unlike the old behavior, all the models are just normal models and not modules that
have to be included. 'include MetasploitDataModels' is still supported
so that a change for metasploit-framework is not necessary.

All models call ActiveSupport.run_load_hook(:mdm_, self) at
the end of the class definition so Rails apps using the models can
register ActiveSupport.on_load hooks to add behavior to the engine's
models that will survive reloads in development mode.

To be a proper engine, the migrations currently in framework for the
models need to be moved into this gem, so most specs cannot be written
until the migrations are moved. Once the migrations are in place, the
spec/dummy rails app can be used to test any Rails behavior.

Due to all these change, including the incompatibility of no longer
supporting include MetasploitDataModel::ActiveRecordModels::..., the
version number jumps to 1.0.0 to follow semantic versioning guidelines.