Updated

app/models/concerns / chatwoot_labels.rb

A
18 lines of codes
2 methods
3.3 complexity/method
4 churn
6.58 complexity
0 duplications
module ChatwootLabels
  1. ChatwootLabels has no descriptive comment
extend ActiveSupport::Concern included do acts_as_taggable_on :chatwoot_conversations_labels acts_as_taggable_tenant :account_id end def update_chatwoot_conversations_labels(labels = nil) update!(chatwoot_conversations_label_list: labels) end def add_chatwoot_conversations_labels(new_labels = nil) new_labels = Array(new_labels) # Make sure new_labels is an array combined_labels = chatwoot_conversations_labels + new_labels update!(chatwoot_conversations_label_list: combined_labels) end end