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

11 lines
297 B
Ruby
Raw Normal View History

class Events::NewMapping < Event
2016-06-30 11:42:46 +08:00
# after_create :notify_users!
def self.publish!(mapping, user)
2016-06-30 11:42:46 +08:00
create!(kind: mapping.mappable_type == 'Topic' ? 'topic_added_to_map' : 'synapse_added_to_map',
eventable: mapping,
map: mapping.map,
user: user)
end
end