Skip to content

Commit

Permalink
Revert "make CSV downloads respect pagination"
Browse files Browse the repository at this point in the history
This reverts commit a8ad4f9.

Ref: #2847
  • Loading branch information
seanlinsley committed Jan 11, 2014
1 parent 9062494 commit 37ba46c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/active_admin/resource_controller/data_access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,23 @@ def current_scope
end

def apply_pagination(chain)
page_method = Kaminari.config.page_method_name
page_param = params[Kaminari.config.param_name]
page_method_name = Kaminari.config.page_method_name
page = params[Kaminari.config.param_name]

chain.send(page_method, page_param).per(per_page)
chain.send(page_method_name, page).per(per_page)
end

def per_page
return max_csv_records if request.format == 'text/csv'
return max_per_page if active_admin_config.paginate == false

@per_page || active_admin_config.per_page
end

def max_csv_records
10_000
end

def max_per_page
10_000
end
Expand Down

0 comments on commit 37ba46c

Please sign in to comment.