Rock'n roll!!

as I said, the updated_at date was properly found by the date range
search. The problem was for dates coming from another class (dates of
next auction for an item).
Well, it was no problem if I had that date on the local table... so
i've put it :-D

-----
# item.rb
has_many :auctions
has_one :next_auction,
        :class_name => 'Auction',
        :conditions => ["date > ?", Time.now]


define_index do
  indexes description
  indexes ....[some other things]

  has next_auction.date, :as => :auction_date
end
-----


And this way it works perfctly, like "created_at" or "updated_at"
local fields, and I can perform searches like this:


Item.search :with => { :auction_date => Time.now.to_i..
5.days.from_now.to_i }



Hope this helps someone. And again thanks for all :-)


--
Iván Belmonte



On Mar 11, 1:46 pm, Iván <[email protected]> wrote:
> No luck, still not working.
> Apart of the typo, any other ideas?
>
> also, is it possible to do something like this:
>
> indexes auctions.last.date, :as => :auction_date, :conditions =>
> { 'auctions.date !null' }
>
> or something similar in any other way?
>
> thanks again,
>
> Iván
>
> On Mar 11, 4:40 am, James Healy <[email protected]> wrote:
>
> > Iván wrote:
> > > oh my god... i'm so sorry. This is what my real code looked like.
> > > I copied my code changing a few things for my explanation being
> > > simpler, but this part was a real typo. Thanx and sorry.
>
> > No worries, it's a mistake I'm sure we've all made at some point.
>
> > It's easy for the eye to miss those sort of spelling 
> > errors:http://www.languagehat.com/archives/000840.php
>
> > -- James Healy <jimmy-at-deefa-dot-com>  Wed, 11 Mar 2009 14:36:29 +1100
>
>
--~--~---------~--~----~------------~-------~--~----~
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