Class: Tiler::DataRecord

Inherits:
ApplicationRecord show all
Defined in:
app/models/tiler/data_record.rb

Constant Summary collapse

INGESTED_VIA =
%w[webhook manual csv].freeze

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



25
26
27
# File 'app/models/tiler/data_record.rb', line 25

def [](key)
  parsed_payload[key.to_s]
end

#parsed_payloadObject



19
20
21
22
23
# File 'app/models/tiler/data_record.rb', line 19

def parsed_payload
  JSON.parse(payload.presence || "{}")
rescue JSON::ParserError
  {}
end