Skip to content

Commit c402e58

Browse files
committed
chore(PageVersion): Use instance methods of Publishable
The Publishable concern provides the same instance methods, but with a slightly different signature. Since these methods are identical and only used internally we can remove them.
1 parent 6826968 commit c402e58

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

app/models/alchemy/page_version.rb

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,32 +29,6 @@ class << self
2929

3030
before_destroy :delete_elements
3131

32-
# Determines if this version is public
33-
#
34-
# Takes the two timestamps +public_on+ and +public_until+
35-
# and returns true if the time given (+Time.current+ per default)
36-
# is in this timespan.
37-
#
38-
# @param time [DateTime] (Time.current)
39-
# @returns Boolean
40-
def public?(time = Current.preview_time)
41-
already_public_for?(time) && still_public_for?(time)
42-
end
43-
44-
# Determines if this version is already public for given time
45-
# @param time [DateTime] (Current.preview_time)
46-
# @returns Boolean
47-
def already_public_for?(time = Current.preview_time)
48-
!public_on.nil? && public_on <= time
49-
end
50-
51-
# Determines if this version is still public for given time
52-
# @param time [DateTime] (Current.preview_time)
53-
# @returns Boolean
54-
def still_public_for?(time = Current.preview_time)
55-
public_until.nil? || public_until >= time
56-
end
57-
5832
def element_repository
5933
ElementsRepository.new(elements)
6034
end

0 commit comments

Comments
 (0)