阅读背景:

如何有条件地通过范围内的标准

来源:互联网 

I am using mongoid 3.15. I have a model called 'Building' with properties: name, province, district, street. I want to create a scope (or class method), called 'in' for example. It should accept a hash criteria that contains one of (or all of) 'province', 'district' and 'street' and - if one of them provided, then it searches by one of those properties - if two or more of them provided, then it should find buildings that match all criteriaI am using mongoid 3.15. I have a model called




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: