Hopefully it's just that my cases keep getting a bit more complex, but I
never quite seem to get the hang of the indexing. Again it would be great
with some advice from someone smarter than me, so I'm trying my luck here
again:
I have a bunch of Dentists, who performs many different Procedures. The
prices of the procedures belong to the organization/clinic the dentist
works at.
Now I have a dentist index, to which I'd like to add support for sorting by
the price of a given procedure. Since a dentist might be connected to
multiple practices, I'm thinking of restricting sorting to the lowest
priced practice. Since this includes quite a few more steps than what I've
encountered so far I have been unable to wrap my head around how to do this.
The simplified data model looks somewhat like this:
class Dentist < Person
has_many :organizations, through: :person_organizations
end
class Organization
has_many :prices, class_name: 'ProcedurePrice'
end
class ProcedurePrice
attr_accessible :price
belongs_to :procedure
end
class Procedure
attr_accessible :name
end
Any ideas on how to solve this?
Cheers,
Roger
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.