Browse files

Added a little documentation to Address

  • Loading branch information...
1 parent a302da7 commit e2d5d7895b49a30eab9aa97b2e437c919b72af64 @jakeboxer committed Feb 4, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 app/models/address.rb
View
3 app/models/address.rb
@@ -100,14 +100,17 @@ def self.shortened_to_id (shortened)
id
end
+ # Finds the URL with the specified shortened id
def self.find_by_shortened (shortened)
Address.find(Address.shortened_to_id(shortened))
end
+ # The shortened id of the Address
def shortened
Address.id_to_shortened self.id
end
+ # Always use the shortened id instead of the regular one for parameters
def to_param
self.shortened
end

0 comments on commit e2d5d78

Please sign in to comment.