app/components/kadmin/finder/presenter.rb in kadmin-0.7.0 vs app/components/kadmin/finder/presenter.rb in kadmin-0.7.1
- old
+ new
@@ -34,10 +34,25 @@
applied_filters = "(filtering: #{filters.join('; ')})" unless filters.empty?
return applied_filters.html_safe
end
+ # @return [Array] an array of optionally presented models
+ def results
+ return @results ||= __getobj__.results.map do |object|
+ if object.class < Kadmin::Presentable
+ object.present(@view)
+ else
+ object
+ end
+ end
+ end
+
# @!group Pager properties
+
+ def pager
+ return @pager ||= __getobj__.pager.present(@view)
+ end
# @return [Integer] the current number of items displayed for this page
def displayed_items
return offset_end - self.pager.offset
end