Skip to content

Number Fix Issue (with Fix) #17

@rsiddle

Description

@rsiddle

On this line https://github.com/olkarls/has_permalink/blob/master/lib/has_permalink.rb#L56 the permalink searches for itself so if you update a model, it always appends a number which isn't correct. Instead the 'where' clause should tell it to not count it's own ID

n = self.class.where(["permalink = ? AND id != ?", permalink, id]).count

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions