public
Rubygem
Description: FriendlyId is the “Swiss Army bulldozer” of slugging and permalink plugins for ActiveRecord. It allows you to create pretty URL’s and work with human-friendly strings as if they were numeric ids for ActiveRecord models.
Homepage: http://friendly-id.rubyforge.org
Clone URL: git://github.com/norman/friendly_id.git
Added small change to allow friendly_id to work with STI. (David Ramalho)
norman (author)
Fri Jul 25 07:21:30 -0700 2008
commit  eb170ce467532473eafde4bb4125a9165481f6c0
tree    f9782eaabe22f197b175eb9da0564b3faa09c7de
parent  0114ba8e8a225981d26e00c2a600b1dd1c9e3a99
...
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
0
@@ -1,3 +1,7 @@
0
+July 25 2008
0
+
0
+* Small change to allow friendly_id to work better with STI. (David Ramalho)
0
+
0
 July 14 2008
0
 
0
 * Improved slug generation for friendly id's with apostrophes. (alistairholt)
...
136
137
138
139
 
140
141
 
142
143
144
...
136
137
138
 
139
140
 
141
142
143
144
0
@@ -136,9 +136,9 @@ module Randomba
0
       def find_using_friendly_id(*args)
0
         case args.first
0
           when String
0
-            slugs = Slug.find_by_name_and_sluggable_type(args.first, self.to_s)
0
+            slugs = Slug.find_by_name_and_sluggable_type(args.first, self.base_class.to_s)
0
           when Array
0
-            slugs = Slug.find_all_by_name_and_sluggable_type(args.first, self.to_s)
0
+            slugs = Slug.find_all_by_name_and_sluggable_type(args.first, self.base_class.to_s)
0
           else
0
             return false
0
         end

Comments