diff --git a/lib/active_admin/axlsx/builder.rb b/lib/active_admin/axlsx/builder.rb index 6fb28ad..ef44235 100644 --- a/lib/active_admin/axlsx/builder.rb +++ b/lib/active_admin/axlsx/builder.rb @@ -74,7 +74,7 @@ def i18n_scope # This is the I18n scope that will be used when looking up your # colum names in the current I18n locale. - # If you set it to [:active_admin, :resources, :posts] the + # If you set it to [:active_admin, :resources, :posts] the # serializer will render the value at active_admin.resources.posts.title in the # current translations # @note If you do not set this, the column name will be titleized. @@ -129,6 +129,7 @@ def delete_columns(*column_names) # Serializes the collection provided # @return [Axlsx::Package] def serialize(collection) + reset_sheet @collection = collection apply_filter @before_filter export_collection(collection) @@ -172,6 +173,10 @@ def export_collection(collection) end end + def reset_sheet + @package, @sheet = nil + end + # tranform column names into array of localized strings # @return [Array] def header_row(collection)