jipiboily/monologue — pull request #132 by alex-quiterio (2013-02-12 18:53:31+00:00)
Title: Refactor generate_url on Monologue::PostsRevision Model

Currently the _generate_url_ method makes multiple queries when the url to be stored already exists. When we have many records on the database with the same name it can be expensive.

My approach tries to minimize the cost of multiple queries and collects all the records with similar url's in a array and checks if the new one exists on the collection or not.