Skip to content
Browse files

Fix. Now permalize! is a real destructive method.

  • Loading branch information...
1 parent c2c7b0a commit 87e897fe12f7da70ab48854915e493c7ff04baf9 Marcos Arias committed Apr 30, 2008
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/permalizer/permalink.rb
View
5 lib/permalizer/permalink.rb
@@ -8,15 +8,14 @@ module InstanceMethods
# blog.title.permalize! # => "my-cool-gem"
#
def permalize!
- Permalink::Permalizer.new(self).to_s
+ replace Permalink::Permalizer.new(self).to_s
end
# permalize is the same as permalize! except that it is not a destructive method
# it creates a duplicate of the string and returns it as a clean string for URL usage
#
def permalize
- string = self.dup
- Permalink::Permalizer.new(string).to_s
+ Permalink::Permalizer.new(self).to_s
end
end

0 comments on commit 87e897f

Please sign in to comment.
Something went wrong with that request. Please try again.