Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created November 20, 2013 13:15
Show Gist options
  • Save vparihar01/7563001 to your computer and use it in GitHub Desktop.
Save vparihar01/7563001 to your computer and use it in GitHub Desktop.
When downloading a csv of a model using active admin hat had around 24k records. But the csv was limited to only 10krows of data ,as it's hardcoded in active admin https://github.com/gregbell/active_admin/blob/master/lib/active_admin/resource_controller/data_access.rb#L276 . So if we try to download the CSV which have more then 12,000 records it…
# Monkey patch to increase the number of records
# exported in csv download -default is 10k
module ActiveAdmin
class ResourceController
module DataAccess
# in active admin 0.6
def max_csv_records
30_000
end
# needed for current active admin master
def max_per_page
30_000
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment