You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general, it was a good experience. However, the first migration failed with a message:
== 20200915155938 CreateNewsItems: migrating ==================================
rails aborted!
StandardError: An error has occurred, all later migrations canceled:
[FriendlyId] You need to translate the 'slug' field with Mobility (add 'translates :slug' in your model 'Refinery::News::Item')
/usr/local/rvm/gems/ruby-2.5.7@refinery403/gems/friendly_id-mobility-0.5.4/lib/friendly_id/mobility.rb:35:in `advise_against_untranslated_model'
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 field slugto the create tablestatement 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):
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
The text was updated successfully, but these errors were encountered: