Class: Moon::Action::Models::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/action/models/updater.rb

Overview

Uses the parameters in the context and tries to update the models.

Defined Under Namespace

Classes: Model

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.perform(context) ⇒ Object



29
30
31
# File 'lib/moon/action/models/updater.rb', line 29

def self.perform(context)
  new(context).perform
end

Instance Method Details

#perform(context) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/moon/action/models/updater.rb', line 5

def perform(context)
  @context = context
  @context.models.each do |model_key, model|
    Model.new(model, @context.parameters[model_key]).update
  end
  nil
end