metamaps--metamaps/app/models/events/new_mapping.rb
2016-09-24 11:00:46 +08:00

11 lines
327 B
Ruby

# frozen_string_literal: true
class Events::NewMapping < Event
# after_create :notify_users!
def self.publish!(mapping, user)
create!(kind: mapping.mappable_type == 'Topic' ? 'topic_added_to_map' : 'synapse_added_to_map',
eventable: mapping,
map: mapping.map,
user: user)
end
end