Hi Alex,

I could be wrong here but the correct syntax should be tracks.from_date instead 
of tracks(:from_date). You only need the parenthesized syntax when indexing 
columns with "special" meaning (e.g. id and name).

HTH,
- Clemens

On Feb 27, 2011, at 6:12 PM, alex wrote:

> Hi,
> 
> I have the following models:
> 
> Track
>  belongs_to course, :touch => true
> 
> Course
>  has_many tracks, :dependent => :destroy, :order =>
> "tracks.from_date"
> 
>  define_index do
>    ....
>    has  tracks(:from_date), :as => :track_from_dates, :type
> => :datetime
>    has  tracks(:to_date), :as => :track_to_dates, :type => :datetime
>  end
> 
> 
> Everything works fine when I don't have the "has tracks(:from/
> to_date)". However, with these 2 lines, I have a bug when I do create
> a Course (even if not track is associated to it), or when I try to
> create or destroy a Track associated to a Course. In every case, the
> Course and Tracks are created and destroyed as planned, but I then get
> the following error message:
> 
>  NoMethodError: undefined method `from_date' for #<Array:0x102962b90>
> 
> With error log involving activerecord-2.3.5, thinking-sphinx-1.3.11,
> activesupport-2.3.5, after_commit-1.0.8.
> 
> 
> I'm not sure where to look to debug it. Any idea?
> 
> Thanks!
> 
> -- 
> 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.

Reply via email to