File tree Expand file tree Collapse file tree 4 files changed +18
-11
lines changed
Expand file tree Collapse file tree 4 files changed +18
-11
lines changed Original file line number Diff line number Diff line change @@ -153,8 +153,13 @@ def document_class_prefix
153153 #
154154 # @param [SolrDocument] document
155155 # @return [String]
156- def render_document_sidebar_partial ( _document = @document )
157- render partial : 'show_sidebar'
156+ def render_document_sidebar_partial ( document = nil )
157+ unless document
158+ Deprecation . warn ( self , 'render_document_sidebar_partial expects one argument ' /
159+ '(@document) and you passed none. This behavior will be removed in version 8' )
160+ document = @document
161+ end
162+ render 'show_sidebar' , document : document
158163 end
159164
160165 ##
Original file line number Diff line number Diff line change 1- <%= render :partial => 'show_tools' %>
2-
3- <% unless @ document.more_like_this.empty? %>
1+ <%= render 'show_tools' %>
2+
3+ <% unless document.more_like_this.empty? %>
44 <div class ="card ">
55 < div class ="card-header "> More Like This</ div >
66 < div class ="card-body ">
7- <%= render :collection => @document . more_like_this , :partial => 'show_more_like_this' , :as => :document %>
7+ <%= render collection : document . more_like_this ,
8+ partial : 'show_more_like_this' ,
9+ as : :document %>
810 </ div >
911 </ div >
10- <% end %>
12+ <% end %>
Original file line number Diff line number Diff line change 88<%= render_document_main_content_partial %>
99
1010<% content_for ( :sidebar ) do %>
11- <%= render_document_sidebar_partial %>
11+ <%= render_document_sidebar_partial @document %>
1212<% end %>
Original file line number Diff line number Diff line change 1717 end
1818
1919 it "shows more-like-this titles in the sidebar" do
20- @ document = SolrDocument . new id : 1 , title_s : 'abc' , format : 'default'
21- allow ( @ document) . to receive ( :more_like_this ) . and_return ( [ SolrDocument . new ( 'id' => '2' , 'title_tsim' => 'Title of MLT Document' ) ] )
22- render
20+ document = SolrDocument . new id : 1 , title_s : 'abc' , format : 'default'
21+ allow ( document ) . to receive ( :more_like_this ) . and_return ( [ SolrDocument . new ( 'id' => '2' , 'title_tsim' => 'Title of MLT Document' ) ] )
22+ render 'catalog/show_sidebar' , document : document
2323 expect ( rendered ) . to include ( "More Like This" )
2424 expect ( rendered ) . to include ( "Title of MLT Document" )
2525 end
You can’t perform that action at this time.
0 commit comments