Add budget investment translations

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.
This commit is contained in:
Senén Rodero Rodríguez
2018-12-23 00:25:23 +01:00
committed by voodoorai2000
parent 8c2f1b894d
commit eefb9ca4f7
4 changed files with 85 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
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