Skip to content

Instantly share code, notes, and snippets.

Working from home

Adrien Rey-Jarthon jarthod

Working from home
View GitHub Profile
jarthod / compressed.rb
Last active Jul 22, 2020 — forked from romanbsd/compressed.rb
Compressed fields in Mongoid 6.4
View compressed.rb
require 'zlib'
class CompressedString < String
def mongoize
class << self
# Get the object as it was stored in the database, and instantiate
# this custom class from it.