Module: Workarea::Commentable

Extended by:
ActiveSupport::Concern
Included in:
Workarea::Catalog::Category, Workarea::Catalog::Product, Content, Workarea::Content::Asset, Workarea::Content::Page, Order, Pricing::Discount, Release, Search::Customization, Segment, User
Defined in:
app/models/workarea/commentable.rb

Instance Method Summary collapse

Instance Method Details

#add_subscription(list) ⇒ Object



16
17
18
19
# File 'app/models/workarea/commentable.rb', line 16

def add_subscription(list)
  all = subscribed_user_ids + clean_subscription_list(list)
  update_attribute(:subscribed_user_ids, all.uniq)
end

#remove_subscription(list) ⇒ Object



21
22
23
24
25
26
# File 'app/models/workarea/commentable.rb', line 21

def remove_subscription(list)
  update_attribute(
    :subscribed_user_ids,
    subscribed_user_ids - clean_subscription_list(list)
  )
end