Class: Usage

Inherits:
ApplicationRecord show all
Defined in:
app/models/usage.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

aggregate_of, all_except, defaults, name_model_as, numbered, #save, #save_and_notify!, #save_and_notify_changes!, #update_and_notify!, update_or_create!

Class Method Details

.destroy_usages_for(record) ⇒ Object



11
12
13
# File 'app/models/usage.rb', line 11

def self.destroy_usages_for(record)
  Usage.where(parent_item: record).destroy_all
end