the `url` field will simplify this too - you can add a `find_by_param` method in the post model.