【文件属性】:
文件名称:lazy_find:简化了ActiveRecord中的first,last,take方法
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-12 13:38:51
rails activerecord first take last
懒人查找
描述
Simplified the first,last,take methods in ActiveRecord.So instead of using where and first, you can directly use first.
安装
将此行添加到您的应用程序的Gemfile中:
gem 'lazy_find'
然后执行:
$ bundle
或将其自己安装为:
$ gem install lazy_find
用法
简化了ActiveRecord中的first,last,take方法。
Find the first record (or first N records if a parameter is supplied).
旧语法:
Person.where(:email => "jenorish@gmail").first
新语法:
【文件预览】:
lazy_find-master
----lazy_find.gemspec(1KB)
----bin()
--------console(344B)
--------setup(131B)
----Rakefile(51B)
----LICENSE(1KB)
----Gemfile(164B)
----.gitignore(73B)
----lib()
--------lazy_find.rb(169B)
--------lazy_find()
----CODE_OF_CONDUCT.md(3KB)
----README.md(2KB)
----LICENSE.txt(1KB)