module Sequel::Plugins::StaticCache::InstanceMethods

def before_destroy

Disallowing destroying the object unless the frozen: false option was used.
def before_destroy
  cancel_action("modifying model objects that use the static_cache plugin is not allowed") unless model.static_cache_allow_modifications?
  super
end

def before_save

Disallowing saving the object unless the frozen: false option was used.
def before_save
  cancel_action("modifying model objects that use the static_cache plugin is not allowed") unless model.static_cache_allow_modifications?
  super
end