Class: Noticed::Coder

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

Class Method Summary collapse

Class Method Details

.dump(data) ⇒ Object



12
13
14
15
# File 'lib/noticed/coder.rb', line 12

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

.load(data) ⇒ Object



5
6
7
8
9
10
# File 'lib/noticed/coder.rb', line 5

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