Module | Sequel::Plugins::SerializationModificationDetection
In: | lib/sequel/plugins/serialization_modification_detection.rb

Sequel‘s built in Serialization plugin doesn‘t check for modification of the serialized objects, because it requires an extra deserialization of a potentially very large object. This plugin can detect changes in serialized values by checking whether the current deserialized value is the same as the original deserialized value. This does require deserializing the value twice, but the original deserialized value is cached.

## Example

      require 'sequel'
      require 'json'
      class User < Sequel::Model
        plugin :serialization, :json, :permissions
        plugin :serialization_modification_detection
      end
      user = User.create(:permissions => {})
      user.permissions[:global] = 'read-only'
      user.save_changes

### Methods

apply

### Classes and Modules

Module Sequel::Plugins::SerializationModificationDetection::InstanceMethods

### Public Class methods

apply(model)

Load the serialization plugin automatically.

[Source]

        # File lib/sequel/plugins/serialization_modification_detection.rb, line 23
    23:       def self.apply(model)
    24:         model.plugin :serialization
    25:       end

[Validate]