Skip to content

Conversation

guewen
Copy link

@guewen guewen commented Feb 3, 2025

Hi, here's a small improvement to defer the content of the message, such as:

  scoped_collection_action :scoped_collection_export_csv,
                           title: I18n.t('active_admin.actions.offers.export_csv'),
                           confirm: lambda {
                             I18n.t('active_admin.actions.offers.collection_export.confirm',
                                    offer_limit: Setting.offer_file_export_count_limit)
                           } do

In this example, Settings needs access to the database, and would be executed at startup if not using a block.

Which allows to defer the content of the message, such as:

  scoped_collection_action :scoped_collection_export_csv,
                           title: I18n.t('active_admin.actions.offers.export_csv'),
                           confirm: lambda {
                             I18n.t('active_admin.actions.offers.collection_export.confirm',
                                    offer_limit: Setting.offer_file_export_count_limit)
                           } do

In this example, Settings needs access to the database, and would be
executed at startup if not using a proc.
@guewen guewen marked this pull request as ready for review February 3, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant