Skip to content

Instantly share code, notes, and snippets.

View yash-doshi's full-sized avatar

Yash Doshi yash-doshi

View GitHub Profile
# Serializing Symbols for ActiveJobs
# For the context of this gist, serialization of symbols simply means deconstruction of symbols into serializable hash.
# include in any ActiveJob where you need to pass symbol(s) in arguments
# Deconstructs any symbol into a standard and discernible Hash, which can be serialized
# Example- :apples => { _serializing_datatype: 'Symbol', _value: 'apples' }
module SymbolSerializer
extend ActiveSupport::Concern
included do