has_permalink icon indicating copy to clipboard operation
has_permalink copied to clipboard

Number Fix Issue (with Fix)

Open rsiddle opened this issue 10 years ago • 0 comments

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

rsiddle avatar Jun 06 '14 11:06 rsiddle