Updated

app/models/concerns / labelable.rb

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