【文件属性】:
文件名称:wherex:使用 Regexp 作为 ActiveRecord 中任何查找器的值
文件大小:17KB
文件格式:ZIP
更新时间:2021-07-10 08:44:36
Ruby
哪里
对 ActiveRecord 查找器的正则表达式支持。
安装
Wherex 是 ,这意味着我们将始终指示向后不兼容的更改与主要版本碰撞,因此您可以在Gemfile使用它:
gem 'wherex' , '~> 1.0'
仅适用于 Rails >= 3.1
例子
# find users in 93, 94 and 95 (5 digit) zipcodes (new style finder)
User . where :zipcode => /^9[345][0-9]{3}$/
# find students with invalid characters in their names (old style finder)
Student . all :conditions => { :name => /[^a-zA-Z ]/ }
# find products with
【文件预览】:
wherex-master
----.gitignore(246B)
----gemfiles()
--------ar_3.1.gemfile(259B)
--------ar_3.2.gemfile(259B)
--------ar_4.0.gemfile(259B)
--------ar_4.2.gemfile(263B)
--------ar_4.1.gemfile(259B)
----bin()
--------appraisal(379B)
--------thor(364B)
--------turn(364B)
--------rg(364B)
--------tapout(370B)
--------rcov(364B)
--------rake(364B)
----.travis.yml(672B)
----.ruby-version(6B)
----LICENSE.txt(1KB)
----README.md(5KB)
----lib()
--------wherex()
--------wherex.rb(298B)
----Appraisals(298B)
----Gemfile(169B)
----Rakefile(426B)
----test()
--------app()
--------config()
--------test_helper.rb(1KB)
--------fixtures()
--------wherex_test.rb(721B)
----wherex.gemspec(946B)
----Gemfile.lock(1KB)