I have friendly_id applied and working but now I dont want it to add a slug if the key_type
is 4
currently I have
extend FriendlyId
friendly_id :value, :use => :scoped, :scope => [:category_item_key, :category_item]
and tired applying an if statement in the model like below
if :key_type == 4
else
extend FriendlyId
friendly_id :value, :use => :scoped, :scope => [:category_item_key, :category_item]
end
But the if statement doesn't seem to do anything. I figured there might be a built in way in friendly_id for this to be done (couldn't see anything in the docs). Or maybe thee is some other way of getting this done so it wont add a slug if the key_type
is equal to 4
?