[英]What is returned by a search with Tire gem in Rails
What is returned when I do a search with the Tire gem in Rails (using Active Record integration)? 当我在Rails中使用Tire宝石搜索时(使用Active Record集成)返回什么? Is the actual models returned or is it some generic object? 返回的是实际模型还是某些通用对象? I don't understand what I get back. 我不明白我得到了什么。
It is an object of collection class. 它是集合类的对象。 you can check this link https://github.com/karmi/tire/blob/master/lib/tire/results/collection.rb 您可以检查此链接https://github.com/karmi/tire/blob/master/lib/tire/results/collection.rb
Please read the Tire's README carefully, namely the parts about the :load
option for model search methods. 请仔细阅读Tyre的自述文件,即有关模型搜索方法的:load
选项的部分。
For background, search Github issues for Item
, and see unit/integration tests for Tire::Results::Collection
and Tire::Results::Item
. 有关背景,请在Github问题中搜索Item
,并查看Tire::Results::Collection
和Tire::Results::Item
单元/集成测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.