Class: Noticed::Coder

Inherits:
Object
  • Object
show all
Defined in:
lib/noticed/coder.rb

Class Method Summary collapse

Class Method Details

.dump(data) ⇒ Object



10
11
12
13
# File 'lib/noticed/coder.rb', line 10

def self.dump(data)
  return if data.nil?
  ActiveJob::Arguments.send(:serialize_argument, data)
end

.load(data) ⇒ Object



3
4
5
6
7
8
# File 'lib/noticed/coder.rb', line 3

def self.load(data)
  return if data.nil?
  ActiveJob::Arguments.send(:deserialize_argument, data)
rescue ActiveRecord::RecordNotFound => error
  {noticed_error: error.message, original_params: data}
end