Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461240
invitation.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 17, 11:56 PM
Size
449 B
Mime Type
text/x-ruby
Expires
Mon, May 19, 11:56 PM (20 h, 46 m)
Engine
blob
Format
Raw Data
Handle
220199
Attached To
rARCHIVING archiving
invitation.rb
View Options
# `Invitation` describes the pending invitation of a user to join a host.
class
Invitation
<
ActiveRecord
::
Base
belongs_to
:user
belongs_to
:host
validates
:user
,
:host
,
:verification_code
,
presence
:
true
before_validation
:calculate_verification_code
private
def
calculate_verification_code
self
.
verification_code
=
Digest
::
SHA256
.
hexdigest
(
[
host
.
name
,
Time
.
now
.
to_s
,
Rails
.
application
.
secrets
.
salt
].
join
)
end
end
Event Timeline
Log In to Comment