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

#modelObject

Returns the value of attribute model



36
37
38
# File 'lib/dynamic-active-model/database.rb', line 36

def model
  @model
end

Instance Method Details

#update_model(&block) ⇒ Object

Updates a model’s definition with the provided block



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

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