binarylogic / searchlogic

Searchlogic provides object based searching, common named scopes, and other useful tools.
http://rdoc.info/projects/binarylogic/searchlogic
MIT License
1.39k stars 133 forks source link

ascend_by and descend_by always return nil #104

Open LanceOlsen opened 14 years ago

LanceOlsen commented 14 years ago

I can't figure out why ascend_by won't work for me. Here's a console readout

>> tapes = Tape.search(:timestamp_gte => "1278361923")
=> blah blah blah

tapes.length
=> 1436
tapes.ascend_by_timestamp
=> nil

I get the same behavior when I use descend_by and other columns.

ruby 1.8.7
Rails 2.3.8
searchlogic 2.4.19

ryanwilliams commented 14 years ago

Tape.ascend_by_id.search seems to work. Tape.ascend_by_id returns an ActiveRecord::NamedScope::Scope instance rather than a SearchLogic::Search instance. Perhaps this is by design?