Also fix sort_by_title method [1] [1] Use ruby sort instead of active record order scope because Globalize does not provide a way to search over all available fallbacks when translation for current locale does not exist.
16 lines
338 B
Ruby
16 lines
338 B
Ruby
class AddBudgetInvestmentTranslations < ActiveRecord::Migration[4.2]
|
|
def self.up
|
|
Budget::Investment.create_translation_table!(
|
|
{
|
|
title: :string,
|
|
description: :text
|
|
},
|
|
{ migrate_data: true }
|
|
)
|
|
end
|
|
|
|
def self.down
|
|
Budget::Investment.drop_translation_table!
|
|
end
|
|
end
|