Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nenad-vujicic committed Jan 19, 2025
1 parent bb9d30f commit 57b066d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def freshly_closed_until
# Return the note's description, unless record is unavailable and
# it will be derived from the first comment
def description
if self[:user_ip].nil? && self[:user_id].nil?
if user_ip.nil? && user_id.nil?
comments.first.body
else
RichText.new("text", self[:description])
Expand All @@ -107,20 +107,20 @@ def author
# Return the note's author ID, unless record is unavailable and
# it will be derived from the first comment
def author_id
if self[:user_ip].nil? && self[:user_id].nil?
if user_ip.nil? && user_id.nil?
comments.first.author_id
else
self[:user_id]
user_id
end
end

# Return the note's author IP address, unless record is unavailable and
# it will be derived from the first comment
def author_ip
if self[:user_ip].nil? && self[:user_id].nil?
if user_ip.nil? && user_id.nil?
comments.first.author_ip
else
self[:user_ip]
user_ip
end
end

Expand Down

0 comments on commit 57b066d

Please sign in to comment.