Module: AssetManager::Translations
- Included in:
- Asset, AssetCategory
- Defined in:
- lib/asset_manager/translations.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/asset_manager/translations.rb', line 3 def self.included(base) base.class_eval do scope :sorted_by_translated, lambda { |field| with_translations(Globalize.fallbacks).order(translations_table_name + '.' + field.to_s) } end end |
Instance Method Details
#translations_for_locales(locales) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/asset_manager/translations.rb', line 11 def translations_for_locales(locales) translations_for = [] locales.map do |locale| translations_for << translation_for(locale) end translations_for end |