Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use findable.reorder() to override the default_scope order

Otherwise the 'by' and 'order' attributes in <r:children:each> and other tags that use render_children_with_pagination are appended to the order option i.o. overwriting it.
  • Loading branch information...
commit 4224df82c6c17795c99d30bce5cbb53591c17d4f 1 parent 708af18
Benny Degezelle jomz authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  app/models/standard_tags.rb
3  app/models/standard_tags.rb
View
@@ -1151,7 +1151,8 @@ def render_children_with_pagination(tag, opts={})
paging = pagination_find_options(tag)
result = []
tag.locals.previous_headers = {}
- displayed_children = paging ? findable.paginate(options.merge(paging)) : findable.all(options)
+ order = options.delete(:order)
+ displayed_children = paging ? findable.paginate(options.merge(paging)).reorder(order) : findable.reorder(order).all(options)
displayed_children.each_with_index do |item, i|
tag.locals.child = item
tag.locals.page = item
Please sign in to comment.
Something went wrong with that request. Please try again.