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

Filters - Support OR filter type with conditions on belongsTo/hasOne fields #321

Merged
merged 5 commits into from
Jun 26, 2019

Conversation

SteveBunlon
Copy link
Member

Add little code to handle 'or' filter type when performing the search.

https://trello.com/c/Yv2J5C8k/3478-filters-support-or-filter-type-with-conditions-on-belongsto-hasone-fields

@SteveBunlon SteveBunlon requested review from VincentMolinie and larcin and removed request for arnaudbesnier June 21, 2019 07:33
@larcin larcin assigned SteveBunlon and unassigned VincentMolinie and larcin Jun 24, 2019
Copy link
Contributor

@larcin larcin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seems to work. I tried to put 3 filters, generate the request then, convert it as curl and launched it with filterType=or and I still got no result.
Screenshot 2019-06-26 at 12 18 17
Screenshot 2019-06-26 at 12 21 49

if @params[:filter]
operator = " #{@params[:filterType]} ".upcase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Unused Variable] - Defined but never used (doesn't seems to be needed)

@params[:filter].each do |field, values|
next unless belongs_to_association?(field)

values.split(',').each do |value|
@records = belongs_to_subfield_filter(field, value)
conditions << OperatorValueParser.get_has_one_condition(@resource, field, value, @params[:timezone])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Linter] - Bad indentation

@larcin larcin merged commit 4b801b5 into devel Jun 26, 2019
@larcin larcin deleted the add_or_filter_type_handler branch June 26, 2019 12:57
@larcin larcin restored the add_or_filter_type_handler branch June 26, 2019 12:58
@larcin larcin deleted the add_or_filter_type_handler branch June 26, 2019 13:04
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.

4 participants