forgeplus/app/models/verification_code.rb

25 lines
500 B
Ruby
Raw Normal View History

2020-11-23 15:35:03 +08:00
# == Schema Information
#
# Table name: verification_codes
#
# id :integer not null, primary key
# code :string(255)
# code_type :integer
# status :integer
# phone :string(255)
# email :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# by_email (email)
# by_phone (phone)
#
2020-03-09 00:40:16 +08:00
class VerificationCode < ApplicationRecord
def effective?
created_at + 10.minute > Time.current
end
end