Module: Sequel::Plugins::StaticCache::InstanceMethods

Defined in:
lib/sequel/plugins/static_cache.rb

Instance Method Summary collapse

Instance Method Details

#before_destroyObject

Disallowing destroying the object unless the frozen: false option was used.


251
252
253
254
# File 'lib/sequel/plugins/static_cache.rb', line 251

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

#before_saveObject

Disallowing saving the object unless the frozen: false option was used.


257
258
259
260
# File 'lib/sequel/plugins/static_cache.rb', line 257

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