From 0990c57f4f1e37f48de9e500da4115222f1ad297 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Tue, 25 Oct 2016 10:49:43 +0800 Subject: [PATCH] anonymous users are nil, so need to remove the `raise` --- 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]))