Open jussihirvi opened 4 years ago
The same error (You need to translate the 'slug' field with Mobility
) appeared again when I visited /refinery/news/items
on my site. The error went away when I edited this line in the refinery/news/item model:
friendly_id :title, :use => [:slugged, :mobility]
into this:
friendly_id :title, use: :slugged
I already use mobility anyway for translations. I did not find any documentation for using :mobility
like that with the friendly_id
command.
I installed this gem for my refinerycms 4.0.3 app (with Rails 5.1) from the matho-update branch:
In general, it was a good experience. However, the first migration failed with a message:
In fact the model already contains
translates :slug
. I checked that by overriding the model first.Anyway, I could run the migrations successfully after temporarily commenting out the function
advise_against_untranslated_model
in the friendly_id gem.First I thought the error is raised because the field
slug
is not yet added to the table in this first migration, but only in a later migration. But it is not that simple. I rolled back all ten migrations, added the fieldslug
to thecreate table
statement of the first migration, and tried to migrate again. Still I got the same error.BTW, in the rollback of the
create table
migration,::Refinery::UserPlugin
was not found, and also this gives an error (because delete_all does not take parameters):So I edited it to