Lazy Serialize is an alternative to ActiveRecord's serialize method which does not serialize each column until the first call to the attribute.
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
lazy_serialize.gemspec

README.md

Lazy Serialize

Buy Me a Coffee

Lazy Serialize is an alternative to ActiveRecord's serialize method which does not serialize each column until the first call to the attribute.

Install

Use git source as its not yet published to rubygems

# Gemfile
gem 'lazy_serialize', git: 'https://github.com/westonganger/lazy_serialize.git'

Usage

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

Credits

Created by Weston Ganger - @westonganger

Buy Me a Coffee