Module: ODDB::State::Admin::SelectIndicationMethods

Included in:
SelectIndication, User::SelectIndication
Defined in:
src/state/admin/selectindication.rb

Defined Under Namespace

Classes: Selection

Instance Method Summary (collapse)

Instance Method Details

- (Object) update



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'src/state/admin/selectindication.rb', line 30

def update
  pointer = @session.user_input(:pointer)
  indication = pointer.resolve(@session.app)
  if(pointer.skeleton == [:create])
    update = {
      @session.language =>  @model.user_input[:indication],
    }
    @session.app.update(indication.pointer, update, unique_email)
  end
  if(error?)
    self
  else
    hash = {
      :indication =>  indication.pointer,
    }
    model = @session.app.update(@model.pointer, hash, unique_email)
    self.class::REGISTRATION_STATE.new(@session, model)
  end
end