From 5163794698b4c3eed2d7f10c51bc2e96f99ebbdf Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 25 Oct 2016 12:26:22 +0800 Subject: [PATCH] anonymous users are nil, so need to remove the `raise` (#841) --- app/models/topic.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/topic.rb b/app/models/topic.rb index 16016621..85f670c3 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -80,7 +80,6 @@ class Topic < ApplicationRecord end def as_json(options = {}) - raise 'You must pass a user' unless options[:user].is_a? User super(methods: [:user_name, :user_image, :calculated_permission, :collaborator_ids]) .merge(inmaps: inmaps(options[:user]), inmapsLinks: inmapsLinks(options[:user]), map_count: map_count(options[:user]), synapse_count: synapse_count(options[:user]))