diff --git a/app/models/problem.rb b/app/models/problem.rb index 4652b51..7747ddd 100644 --- a/app/models/problem.rb +++ b/app/models/problem.rb @@ -1,5 +1,6 @@ class Problem < ActiveRecord::Base - has_one :translation + # TODO Check whether there is a better relation for this + belongs_to :translation delegate :title, :content, to: :translation has_many :translations, inverse_of: :problem diff --git a/test/fixtures/problems.yml b/test/fixtures/problems.yml index 95b9482..48dcf94 100644 --- a/test/fixtures/problems.yml +++ b/test/fixtures/problems.yml @@ -2,11 +2,11 @@ one: id: 1 - translation_id: <%= ActiveRecord::FixtureSet.identify(:translation_one) %> + translation: translation_one two: id: 2 - translation_id: <%= ActiveRecord::FixtureSet.identify(:translation_two) %> + translation: translation_two three: id: 3