impress/lib/serializers/integer_set.rb
Emi Matchu e52838ba70 Use Rails serialize method to save/load cached fields in Item
Just packing some serialization complexity away into its own thing, so
the model code doesn't need to sweat it!
2024-10-02 17:50:42 -07:00

11 lines
No EOL
171 B
Ruby

module Serializers
module IntegerSet
def self.dump(array)
array.sort.join(",")
end
def self.load(string)
(string || "").split(",").map(&:to_i)
end
end
end