Module: Dipa::Models::Loadable

Extended by:
ActiveSupport::Concern
Included in:
Agent, Coordinator
Defined in:
app/models/concerns/dipa/models/loadable.rb

Instance Method Summary collapse

Instance Method Details

#load_from_file(attacher:) ⇒ Object



8
9
10
11
12
13
14
# File 'app/models/concerns/dipa/models/loadable.rb', line 8

def load_from_file(attacher:)
  return unless __send__(attacher).attached?

  Marshal.load( # rubocop:disable Security/MarshalLoad
    __send__(attacher).download
  )
end