Friendly_id / acts_as_referenced conflict?


#1

Hi,

I’m using acts_as_referenced to generate unique references:

property.rb

class Property < ActiveRecord::Base
acts_as_referenced :referenced_column => “permalink”
end

I would now like to use friendly_id to create seo friendly URLs instead
of using the id.

I now have:

property.rb

class Property < ActiveRecord::Base
acts_as_referenced :referenced_column => “permalink”
has_friendly_id :permalink, :use_slug => true
end

The above code generates a “slug text is blank” error - I assume this is
due to acts_as_referenced using a before_save callback to generate the
permalink which friendly_id is looking for.

Is it possible to get the two plugins working together? Initialize the
acts_as_referenced first?