metamaps--metamaps/app/models/events/topic_added_to_map.rb
Connor Turland b0deafc53e Follows and some new notifications (#1063)
* all the good changes

* follows

* dont send duplicates

* remove follow_type for now

* dont add all the extra stuff we're not implementing yet

* refactor

* lots of fixes

* Delete activity.html.erb

* Delete activity.text.erb

* Update 20170209215819_create_follows.rb

* Update schema.rb

* Update mapping.rb

* Update mailboxer.rb
2017-02-11 00:20:42 -05:00

21 lines
626 B
Ruby

# frozen_string_literal: true
module Events
class TopicAddedToMap < Event
after_create :notify_users!
def self.publish!(topic, map, user, meta)
create!(kind: 'topic_added_to_map',
eventable: topic,
map: map,
user: user,
meta: meta)
end
def notify_users!
# in the future, notify followers of both the topic, and the map
NotificationService.notify_followers(eventable, TOPIC_ADDED_TO_MAP, self)
# NotificationService.notify_followers(map, MAP_RECEIVED_TOPIC, self)
end
handle_asynchronously :notify_users!
end
end