Module: DynamicActiveModel

Defined in:
lib/dynamic-active-model.rb,
lib/dynamic-active-model/setup.rb,
lib/dynamic-active-model/factory.rb,
lib/dynamic-active-model/database.rb,
lib/dynamic-active-model/explorer.rb,
lib/dynamic-active-model/foreign_key.rb,
lib/dynamic-active-model/associations.rb,
lib/dynamic-active-model/template_class_file.rb,
lib/dynamic-active-model/dangerous_attributes_patch.rb

Overview

DynamicActiveModel is a Ruby gem that provides automatic database discovery, model creation, and relationship mapping for Rails applications.

It allows developers to dynamically create ActiveRecord models from existing database schemas without manually writing model classes. The gem automatically detects and sets up relationships including has_many, belongs_to, has_one, and has_and_belongs_to_many based on database constraints.

Examples:

Basic Usage

module DB; end
DynamicActiveModel::Explorer.explore(DB, database_config)

Model Extension

db = DynamicActiveModel::Database.new(DB, database_config)
db.update_model(:users) do
  def full_name
    "#{first_name} #{last_name}"
  end
end

Defined Under Namespace

Modules: DangerousAttributesPatch, Explorer, Setup Classes: Associations, Database, Factory, ForeignKey, ModelNotFound, TemplateClassFile