首页 开发技术 其它     /    确保:添加能力以“确保”ActiveRecords为完整记录-源码

确保:添加能力以“确保”ActiveRecords为完整记录-源码

上传者: weixin_42160398 | 上传时间:2024/12/19 8:53:53 | 文件大小:15KB | 文件类型:ZIP
确保:添加能力以“确保”ActiveRecords为完整记录-源码
保障性让您确保您拥有期望的课程...类似于result=value.is_a?(Person)?value:Person.find(value)您可以将字段添加到“ensure_by”(self.primary_key为self.primary_key),例如如果将ensure_by:token添加到User类,则User.ensure()起作用User.ensure(:user_id)起作用User.ensure(:token)起作用如果未找到记录,.ensure()返回nil。
如果未找到记录,.ensure!()引发异常安装将此行添加到您的应用程序的Gemfile中:gem'ensurance'然后执行:$bundle用法在您的Rails应用中...在特定模型或ApplicationRecordincludeEnsurance以 本软件ID:15351462

文件下载

资源详情

[{"title":"(27个子文件15KB)确保:添加能力以“确保”ActiveRecords为完整记录-源码","children":[{"title":"ensurance-master","children":[{"title":"LICENSE.txt <span style='color:#111;'>1.05KB</span>","children":null,"spread":false},{"title":"lib","children":[{"title":"ensurance","children":[{"title":"date_ensure.rb <span style='color:#111;'>1.66KB</span>","children":null,"spread":false},{"title":"hash_ensure.rb <span style='color:#111;'>1.14KB</span>","children":null,"spread":false},{"title":"array_ensure.rb <span style='color:#111;'>826B</span>","children":null,"spread":false},{"title":"version.rb <span style='color:#111;'>49B</span>","children":null,"spread":false},{"title":"time_ensure.rb <span style='color:#111;'>1.26KB</span>","children":null,"spread":false}],"spread":true},{"title":"ensurance.rb <span style='color:#111;'>2.43KB</span>","children":null,"spread":false}],"spread":true},{"title":"Gemfile <span style='color:#111;'>165B</span>","children":null,"spread":false},{"title":"spec","children":[{"title":"array_spec.rb <span style='color:#111;'>846B</span>","children":null,"spread":false},{"title":"ensurance_spec.rb <span style='color:#111;'>114B</span>","children":null,"spread":false},{"title":"time_spec.rb <span style='color:#111;'>1.40KB</span>","children":null,"spread":false},{"title":"active_record_spec.rb <span style='color:#111;'>3.98KB</span>","children":null,"spread":false},{"title":"hash_spec.rb <span style='color:#111;'>835B</span>","children":null,"spread":false},{"title":"spec_helper.rb <span style='color:#111;'>380B</span>","children":null,"spread":false},{"title":"date_spec.rb <span style='color:#111;'>1.40KB</span>","children":null,"spread":false},{"title":"database.yml <span style='color:#111;'>244B</span>","children":null,"spread":false}],"spread":true},{"title":"Rakefile <span style='color:#111;'>114B</span>","children":null,"spread":false},{"title":".travis.yml <span style='color:#111;'>88B</span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'>3.23KB</span>","children":null,"spread":false},{"title":"ensurance.gemspec <span style='color:#111;'>1.67KB</span>","children":null,"spread":false},{"title":".rspec <span style='color:#111;'>53B</span>","children":null,"spread":false},{"title":"Gemfile.lock <span style='color:#111;'>1.33KB</span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'>128B</span>","children":null,"spread":false},{"title":"bin","children":[{"title":"console <span style='color:#111;'>344B</span>","children":null,"spread":false},{"title":"setup <span style='color:#111;'>131B</span>","children":null,"spread":false},{"title":"rspec <span style='color:#111;'>795B</span>","children":null,"spread":false}],"spread":true},{"title":"CHANGELOG.md <span style='color:#111;'>407B</span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明