Skip to content

Commit cd625b2

Browse files
committed
added PinnedLink#timed? for checking if a featured link is time-constrained
1 parent e412ff0 commit cd625b2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app/models/pinned_link.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
class PinnedLink < ApplicationRecord
22
include MaybeCommunityRelated
33
belongs_to :post
4+
5+
# Is the link time-constrained?
6+
# @return [Boolean] check result
7+
def timed?
8+
shown_before.present? || shown_after.present?
9+
end
410
end

0 commit comments

Comments
 (0)