문제

I had the following in searchlogic:

Todo.contact_id_is(self.id).ascend_by_original_date.done_date_not_null.first

How would I do this in metawhere now that I am in Rails 3? In particular the not_null and the sorting?

Hello, I'm a little confused. When I look at the named scopes found in meta_search (instead of metawhere)...that's more of what I'm looking for...and now metasearch is being replaced with ransack....

What is the way to do chained searches with sql on my models in the way searchlogic made it so drop-dead easy?

...okay...now it looks like ransack is for forms, but queries on models is squeel? Checking that out....

도움이 되었습니까?

해결책

It seems that metawhere doesn't have != operator it was added in sqeel so here is a possible workaround

Todo.where( { :contact_id => self.id} ).order( :original_date.asc ).where( '"todos"."done_date" NOT NULL' ).first
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top