that:Rails 控制台万能寻物机

时间:2021-07-04 04:58:38
【文件属性】:
文件名称:that:Rails 控制台万能寻物机
文件大小:25KB
文件格式:ZIP
更新时间:2021-07-04 04:58:38
Ruby 那 Rails 控制台多用途寻物机。 GitHub Rails 应用程序在控制台中有一个很好的辅助方法,称为dat ,它可以从基于字符串的各种模型中获取正确的信息。 这是用于通用用途的类似内容(根本不基于相同的实现,我只是希望能够在我的所有 Rails 应用程序中输入dat :thedaniel )。 在 Rails 应用程序中搜索所有 AR 模型以查找与字符串的匹配项。 检查除非模型有一个:to_that类方法,该方法返回要检查的符号数组。 如果只有一个,则返回匹配项,否则返回匹配项数组。 irb(main):001:0> that 'thedaniel' User Load (39.2ms) SELECT "users".* FROM "users" WHERE "users"."name" = 'thedaniel' User Load (0.5ms) SELE
【文件预览】:
that-master
----lib()
--------that()
--------that.rb(978B)
----Gemfile(38B)
----LICENSE(1KB)
----test()
--------test_helper.rb(469B)
--------dummy()
--------that_test.rb(124B)
----README.md(1KB)
----.gitignore(140B)
----that.gemspec(819B)

网友评论