How do I set up fixtures for models translations in a Rails app using Mobility?
Currently, I have the following directory structure:
test
fixtures
article
translations.yml
articles.yml
# test/fixtures/articles.yml
past_article:
type: BlogPost
author: Barney Rubble
posted_on: <%= 5.days.ago.to_s(:db) %>
hero_image_id: 1
# test/fixtures/article/translations.yml
past_article_translation:
article: past_article
locale: en
title: Past Article Fixture
subtitle: Temporary subtitle
body: This is the temporary blog post content.
I get ActiveRecord::Fixture::FixtureError: table "article_translations" has no column named "article".
when trying to run my tests.
With Globalize gem, I could change the key in translations.yml
from article
to globalized_model
, but that doesn't work with Mobility.