Class: DynamicActiveModel::Database::ModelUpdater

Inherits:
Struct
  • Object
show all
Defined in:
lib/dynamic-active-model/database.rb

Overview

Helper class for updating model definitions

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#model ⇒ Object

Returns the value of attribute model

Returns:

  • (Object) —

    the current value of model



40
41
42
# File 'lib/dynamic-active-model/database.rb', line 40

def model
  @model
end

Instance Method Details

#update_model(&block) ⇒ Object

Updates a model's definition with the provided block

Parameters:

  • block (Proc) —

    Code to evaluate in the model's context



43
44
45
# File 'lib/dynamic-active-model/database.rb', line 43

def update_model(&block)
  model.class_eval(&block)
end