diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 3bd9829fe40..3c291f060e7 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -72,19 +72,16 @@ def show end def feed - begin - @tag = Tag.find(params[:id]) - rescue ActiveRecord::RecordNotFound - raise ActiveRecord::RecordNotFound, "Couldn't find tag with id '#{params[:id]}'" - end + @tag = Tag.find(params[:id]) @tag = @tag.merger if !@tag.canonical? && @tag.merger # Temp for testing if %w(Fandom Character Relationship).include?(@tag.type.to_s) || @tag.name == 'F/F' - if @tag.canonical? - @works = @tag.filtered_works.visible_to_all.order('created_at DESC').limit(25) - else - @works = @tag.works.visible_to_all.order('created_at DESC').limit(25) - end + @works = if @tag.canonical? + @tag.filtered_works + else + @tag.works + end + @works = @works.visible_to_all.order(created_at: :desc).limit(25).includes(:tags, :language, :series) else redirect_to(tag_works_path(tag_id: @tag.to_param)) && return end diff --git a/app/helpers/works_helper.rb b/app/helpers/works_helper.rb index 36ab1e42a94..fe788bba8f1 100644 --- a/app/helpers/works_helper.rb +++ b/app/helpers/works_helper.rb @@ -174,7 +174,7 @@ def feed_summary(work) text = +"

by #{byline(work, { visibility: 'public', only_path: false })}

" text << work.summary if work.summary text << "

Words: #{work.word_count}, Chapters: #{chapter_total_display(work)}, Language: #{work.language ? work.language.name : 'English'}

" - text << "

Series: #{series_list_with_work_position(work)}

" unless work.series.count.zero? + text << "

Series: #{series_list_with_work_position(work)}

" unless work.series.size.zero? # Create list of tags text << "