module DutyFree::Serializers::YAML

The default serializer for, e.g. `versions.object`.

Public Instance Methods

dump(object) click to toggle source
# File lib/duty_free/serializers/yaml.rb, line 15
def dump(object)
  ::YAML.dump object
end
load(string) click to toggle source
# File lib/duty_free/serializers/yaml.rb, line 11
def load(string)
  ::YAML.safe_load string
end
where_object_condition(arel_field, field, value) click to toggle source

Returns a SQL LIKE condition to be used to match the given field and value in the serialized object.

# File lib/duty_free/serializers/yaml.rb, line 21
def where_object_condition(arel_field, field, value)
  arel_field.matches("%\n#{field}: #{value}\n%")
end