开发者

how would I translate this from searchlogic to metwhere in Rails 3?

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 开发者_JAVA百科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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜