Finder Methods
实例方法:
exists?
find
find_by
find_by!
take
take!
和:
first
first!
second
second!
third
third!
fourth
fourth!
fifth
fifth!
forty_two
forty_two!
last
last!
除上述方法外,还有一些 protected 方法,但它们一般不会直接使用到。
Rails 5 里
find
可以传递数组,如果没有明确排序的话,默认就使用数组里元素的顺序,这个太赞了。
最后更新于
这有帮助吗?