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
<result success="false">
undefined method `domains' for #<ArtistUrl:0x00005566dd340af0> Did you mean? DomainName
</result>
`to_xml` passes down the `methods` param to all nested models, which
doesn't work.
This commit is contained in:
@@ -46,7 +46,7 @@ class ArtistsController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@artist = Artist.find(params[:id])
|
@artist = Artist.find(params[:id])
|
||||||
@post_set = PostSets::Artist.new(@artist)
|
@post_set = PostSets::Artist.new(@artist)
|
||||||
respond_with(@artist, methods: [:domains], include: [:urls])
|
respond_with(@artist)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ class ArtistsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
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
|
should "get the new page" do
|
||||||
get_auth new_artist_path, @user
|
get_auth new_artist_path, @user
|
||||||
assert_response :success
|
assert_response :success
|
||||||
|
|||||||
Reference in New Issue
Block a user