From 91d1817abfcf2d25ddd51c4ce26a5c8da16eb78e Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 17 Nov 2019 18:24:06 -0600 Subject: [PATCH] artists: don't return `domains` in /artists/{id}.xml. Don't return the `domains` field in /artists/{id}.{json,xml}. Fixes a failure in /artists/{id}.xml: https://danbooru.donmai.us/artists/156646.xml undefined method `domains' for # Did you mean? DomainName `to_xml` passes down the `methods` param to all nested models, which doesn't work. --- app/controllers/artists_controller.rb | 2 +- test/functional/artists_controller_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb index 932e63ecd..6a123366b 100644 --- a/app/controllers/artists_controller.rb +++ b/app/controllers/artists_controller.rb @@ -46,7 +46,7 @@ class ArtistsController < ApplicationController def show @artist = Artist.find(params[:id]) @post_set = PostSets::Artist.new(@artist) - respond_with(@artist, methods: [:domains], include: [:urls]) + respond_with(@artist) end def create diff --git a/test/functional/artists_controller_test.rb b/test/functional/artists_controller_test.rb index 76fdf95ba..65d1184f5 100644 --- a/test/functional/artists_controller_test.rb +++ b/test/functional/artists_controller_test.rb @@ -38,6 +38,13 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest end end + context "show action" do + should "work for xml responses" do + get artist_path(@masao.id), as: :xml + assert_response :success + end + end + should "get the new page" do get_auth new_artist_path, @user assert_response :success