-
-
Notifications
You must be signed in to change notification settings - Fork 594
Friendly_id with inheritance
Nico edited this page Jun 25, 2014
·
3 revisions
Case:
Say you have this classes:
class User < ActiveRecord::Base
extend FriendlyId
friendly_id :name, :use => [:slugged, :finders]
end
class SpecificUser < User
endIn order to find by slug:
specific_user = SpecificUser.find "jon-snow"We need to explicitly define the use of friendly_id finder plugin inside SpecificUser
class SpecificUser < User
friendly_id :name, :use => [:finders]
endThis is because each class has its own Friendly_id configuration and is not inherited.