Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Handling of Custom-Defined ActiveRecord Queries #5

Open
wants to merge 1 commit into
base: integration
Choose a base branch
from

Conversation

aaronskiba
Copy link
Collaborator

  • This PR enables handling of custom-defined ActiveRecord queries:
    • Within the codebase using this gem as a dependency, the config.db_fields hash is set in config/initializers/translation.rb. Within config.db_fields, if the 'CallableQueries' key is added, then the value must be an array of ActiveRecord query procs.
    • Within this codebase, lib/translation_io/client/base_operation/dump_db_text_keys_step.rb checks for @db_fields['CallableQueries']. If the value is not nil, then each proc in the provided array is executed and all of the returned results are uploaded to translation.io.

This code change enables handling of  `@db_fields['CallableQueries']`.

The `config.db_fields` hash is set in `config/initializers/translation.rb` of the codebase using this gem. Within `config.db_fields`, if the 'CallableQueries' key is added, then the value must be an array of callable ActiveRecord query procs. Those query procs are then executed here and their returned results are added to the entries array.
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