![](/img/trans.png)
[英]I want to add a Facebook style messenger to my Ruby on Rails application so Users from the User model can have a conversation with each other
[英]i want to validate a date for my attandance request model which accociates with user model ruby on rails
我有一个内置唯一性验证的 Model AttendanceRequest
。
这是我的 model:
class AttendanceRequest < ApplicationRecord
validates_uniqueness_of :login_time, :logout_time
end
目前 model 验证所有用户的唯一性,但我希望它验证单个用户的唯一性,而不是每个用户。
你能帮我吗?
你不能这样做,你需要做一些不同的链接给第一次注销时间的默认值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.