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

Change query limit settings format to nested mappings #4189

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

Conversation

AntonKhorev
Copy link
Collaborator

Instead of settings named like this Settings.max_changeset_query_limit
it will be easier to work with Settings.changesets.max_query_limit.

It matches the api capabilities response structure better.
It will be easier to create a generic result_limit method.

Also added settings validation in config/initializers/config.rb.

@tomhughes
Copy link
Member

I'm not sure about this one I have to say - there are plenty of other settings that work as a group where we haven't done this.

@AntonKhorev
Copy link
Collaborator Author

I don't want to write something like Settings["max_#{type}_query_limit"] in a possible superclass method.

@AntonKhorev
Copy link
Collaborator Author

The idea is

  • create a superclass for things searchable by the api; currently they are changesets and notes
  • it's going to have result_limit method
  • but result_limit reads type-specific settings
  • then also add a method to read type-specific settings, rather than read them from the global Settings object; this is going to be either an abstract method to be defined in subclasses or derived from controller_name like in Support versions in elements multi fetch #3715

@AntonKhorev AntonKhorev marked this pull request as draft March 19, 2024 04:40
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.

2 participants