diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 73782eef8..d047ffe60 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -186,8 +186,8 @@ module ApplicationHelper def follow_button(followable, style = "full", classes = "") return if followable == Users::DeletedUser - user_follow = followable.instance_of?(User) ? "follow-user" : "" followable_type = followable.class_name + user_follow = followable_type.include?("User") ? "follow-user" : "" # User or UserDecorator followable_name = followable.name tag.button( diff --git a/spec/liquid_tags/user_tag_spec.rb b/spec/liquid_tags/user_tag_spec.rb index 0570039e4..fc8c7c30f 100644 --- a/spec/liquid_tags/user_tag_spec.rb +++ b/spec/liquid_tags/user_tag_spec.rb @@ -19,6 +19,11 @@ RSpec.describe UserTag, type: :liquid_tag do liquid = generate_user_tag(user.username) expect(liquid.render).to include("