简体   繁体   中英

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)? 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

Please read the Tire's README carefully, namely the parts about the :load option for model search methods.

For background, search Github issues for Item , and see unit/integration tests for Tire::Results::Collection and Tire::Results::Item .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM