Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/has_permalink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def to_param
# Autofix duplication of permalinks
def fix_duplication(permalink)
if auto_fix_duplication
n = self.class.where(["permalink = ?", permalink]).count
n = self.class.base_class.where(["permalink = ?", permalink]).count

if n > 0
links = self.class.where(["permalink LIKE ?", "#{permalink}%"]).order("id")
links = self.class.base_class.where(["permalink LIKE ?", "#{permalink}%"]).order("id")

number = 0

Expand Down