Module: Yogo::Collection::Static::ModelConfiguration

Included in:
Yogo::Collection::Static
Defined in:
lib/yogo/collection/static/model_configuration.rb

Instance Method Summary collapse

Instance Method Details

#after_model_generate(model) ⇒ Object



13
14
15
# File 'lib/yogo/collection/static/model_configuration.rb', line 13

def after_model_generate(model)
  model
end

#after_model_update(model) ⇒ Object



25
26
27
# File 'lib/yogo/collection/static/model_configuration.rb', line 25

def after_model_update(model)
  model
end

#before_model_generateObject



10
11
# File 'lib/yogo/collection/static/model_configuration.rb', line 10

def before_model_generate
end

#before_model_update(model) ⇒ Object



21
22
23
# File 'lib/yogo/collection/static/model_configuration.rb', line 21

def before_model_update(model)
  model
end

#model_generateObject



5
6
7
8
# File 'lib/yogo/collection/static/model_configuration.rb', line 5

def model_generate
  model_name = self.static_model
  ActiveSupport::Inflector.constantize(model_name)
end

#model_update(model) ⇒ Object



17
18
19
# File 'lib/yogo/collection/static/model_configuration.rb', line 17

def model_update(model)
  model.extend(Base::ModelCollectionContext) unless model.respond_to?(:current_collection)
end