Skip to content

Commit

Permalink
Minor tweak to valid method in the invitation serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
alihadimazeh committed Jun 20, 2024
1 parent fd78932 commit 0314e5f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/serializers/invitation_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class InvitationSerializer < ApplicationSerializer
attributes :id, :email, :updated_at, :valid

def valid
expiration_time = object.updated_at + Invitation::INVITATION_VALIDITY_PERIOD

Time.current <= expiration_time
object.updated_at < Invitation::INVITATION_VALIDITY_PERIOD.ago
end
end

0 comments on commit 0314e5f

Please sign in to comment.