2016-03-12 23:36:38 +00:00
|
|
|
class Events::NewMapping < Event
|
2016-07-26 00:14:23 +00:00
|
|
|
# after_create :notify_users!
|
2016-03-12 23:36:38 +00:00
|
|
|
|
|
|
|
def self.publish!(mapping, user)
|
2016-07-26 00:14:23 +00:00
|
|
|
create!(kind: mapping.mappable_type == 'Topic' ? 'topic_added_to_map' : 'synapse_added_to_map',
|
2016-03-12 23:36:38 +00:00
|
|
|
eventable: mapping,
|
|
|
|
map: mapping.map,
|
|
|
|
user: user)
|
|
|
|
end
|
|
|
|
end
|