An open API service indexing awesome lists of open source software.

https://github.com/westonganger/lazy_serialize

Lazy Serialize is an alternative to ActiveRecord's serialize method which does not serialize each column until the first call to the attribute.
https://github.com/westonganger/lazy_serialize

activerecord database rails ruby serialization

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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

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

# Usage

Usage is almost the same as the regular serialize

```ruby
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