You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I introduce facets for language and ethnicity
class WriterSearch < FortyFacets::FacetSearch
model 'IndexedWriter' # which model to search for
facet :ethnicities, name: "Ethnicities"
facet :languages, name: "Languages"
end
Languages works perfectly, but throws ERROR: missing FROM-clause entry for table "ethnicities_indexed_writers" when I try the other.
After some debugging I've determined the source of the issue is where the join table gets calculated:
The sort in this line resolves the join table indexed_writers_languages correctly since 'i' < 'l', but it does resolve the ethnicities join table as ethnicities_indexed_writers. This obviously is wrong, and for my case I can change the line to:
For others in this boat - this lexicagraphic ordering is the rails default, FF is following that convention -- it might be better to read the through table off the model, but this behaves in-line with rails generally.
Hi all,
I've been using the system for a while now, and it has been working great for me. However, I've added a new facet, and am running into an issue.
I have 5 relavent models/tables
When I introduce facets for
language
andethnicity
Languages works perfectly, but throws
ERROR: missing FROM-clause entry for table "ethnicities_indexed_writers"
when I try the other.After some debugging I've determined the source of the issue is where the join table gets calculated:
https://github.com/FortySource/forty_facets/blob/master/lib/forty_facets/filter/facet_filter_definition.rb#L132
The
sort
in this line resolves the join tableindexed_writers_languages
correctly since 'i' < 'l', but it does resolve the ethnicities join table asethnicities_indexed_writers
. This obviously is wrong, and for my case I can change the line to:But this change breaks a test.
Please advise!
The text was updated successfully, but these errors were encountered: