Lazy Serialize is an alternative to ActiveRecord's
serialize method which does not serialize each column until the first call to the attribute.
Use git source as its not yet published to rubygems
# Gemfile gem 'lazy_serialize', git: 'https://github.com/westonganger/lazy_serialize.git'
Usage is almost the same as the regular serialize
class MyClass include LazySerialize lazy_serialize :my_attribute, Hash end
Available Types are Hash, HashWithIndifferentAccess, Array, JSON, YAML
Created by Weston Ganger - @westonganger