Module: Troo::RemoteModelHelpers::InstanceMethods

Defined in:
lib/troo/helpers/remote_model_helpers.rb

Instance Method Summary collapse

Instance Method Details

#localOhm::Model

Returns:

  • (Ohm::Model)


47
48
49
# File 'lib/troo/helpers/remote_model_helpers.rb', line 47

def local
  @local ||= local_model.by_external_id(id)
end

#preprocessObject

Returns [].

Returns:



38
39
40
41
42
43
44
# File 'lib/troo/helpers/remote_model_helpers.rb', line 38

def preprocess
  associations.map do |association|
    associated(association).map { |record| record.preprocess }
  end

  Persistence::Local.persist(self)
end