You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/models/verification_code.rb

10 lines
470 B

6 years ago
class VerificationCode < ActiveRecord::Base
#status发送状态
5 years ago
#code_type发送类型type 1注册手机验证码 2找回密码手机验证码 3找回密码邮箱验证码 4绑定手机 5绑定邮箱 6手机验证码登录 7邮箱验证码登录 8邮箱注册验证码, 9验证手机号有效
6 years ago
attr_accessible :code, :code_type, :email, :phone, :status
def valid_code?
(Time.now.to_i - created_at.to_i) <= 10*60
end
6 years ago
end