metamaps--metamaps/app/models/events/topic_updated.rb

19 lines
397 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-11-06 16:15:18 +00:00
module Events
class TopicUpdated < Event
2017-11-06 16:15:18 +00:00
# after_create :notify_users!
def self.publish!(topic, user, meta)
create!(kind: 'topic_updated',
eventable: topic,
user: user,
meta: meta)
end
2017-11-06 16:15:18 +00:00
def notify_users!
NotificationService.notify_followers(eventable, 'topic_updated', self)
end
end
end