Method: Conflow::Redis::Model#destroy!
- Defined in:
- lib/conflow/redis/model.rb
#destroy!(execute: true) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Removes this and all related models.
22 23 24 25 26 27 28 29 |
# File 'lib/conflow/redis/model.rb', line 22 def destroy!(execute: true) keys = self.class.fields.map { |name| send(name).key } = self.class.relations.map(&method(:collect_relation_keys)) (keys + ).flatten.tap do |key_list| command :del, [key_list] if execute && key_list.any? end end |