Hi Victor
You'd need to add that column as an attribute in your TripDay index, via the
trip association.
--
Pat
On 09/04/2011, at 6:48 PM, Victor wrote:
> Hi Pat, using ROR 2.3.8
>
> I have this in City.rb:
>
> @trip_days = TripDay.published.search params[:keyword], {
> :conditions => conditions,
> :star => true,
> :group_by => 'trip_id',
> :group_function => :attr,
> :page => params[:page]
> }.merge(:order => 'rating_average DESC')
> @trips = @trip_days.collect { |trip_day| trip_day.trip }
>
> How can I tell Rails to get the rating_average from Trip model column,
> instead of TripDay model? Because the TripDay model does not have
> rating_average. It's actually Trip model that gets rated.
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/thinking-sphinx?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en.