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

Modify db_fields hash in translation.rb config #745

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

Conversation

aaronskiba
Copy link
Collaborator

Fixes #553

Changes proposed in this PR:

  • This commit modifies how the templates-related tables ('templates', 'phases', 'sections', 'questions', 'annotations', and 'question_options') are queried within our customisation of the translation gem. All of those related tables are removed from config.db_fields. However, the tables (along with their previously specified columns) are now all included in the newly added Template ActiveRecord query (line 24). Rather than returning all of the db entries, this query only returns those that relate to the app's default_org.
  • 'CallableQueries' => [templates_data_for_default_org_proc] has been added to config.db_fields.def templates_data_for_default_org_proc returns a proc. This proc will be called within the translation gem, where it will execute the aforementioned Template ActiveRecord query. Finally, the returned entries will be uploaded to translation.io.

This commit modifies how the templates-related tables ('templates', 'phases', 'sections', 'questions', 'annotations', and 'question_options') are queried within our customisation of the translation gem. All of those related tables are removed from config.db_fields. However, the tables (along with their previously specified columns) are now all included in the newly added Template ActiveRecord query (line 24). Rather than returning all of the db entries, this query only returns those that relate to the app's default_org.

 `'CallableQueries' => [templates_data_for_default_org_proc]` has been added to config.db_fields.`def templates_data_for_default_org_proc` returns a proc. This proc will be called within the translation gem, where it will execute the aforementioned Template ActiveRecord query. Finally,  the returned entries will be uploaded to translation.io.
@aaronskiba
Copy link
Collaborator Author

The code to handle @db_fields['CallableQueries'] is currently within the following open PR: ualbertalib/translation_io_rails#5. This PR will remain a Draft until the other is merged.

@aaronskiba
Copy link
Collaborator Author

Some manual testing of this PR is documented in issue #553.

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.

None yet

1 participant