Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ext/controller_ext.rb

Instance Method Summary collapse

Instance Method Details

#preload_translations_for(*collections) ⇒ Object

Preload the translations string for all the collections. This allow to load all translation resources in only one SQL query. Take in consideration this will execute the request



10
11
12
# File 'lib/ext/controller_ext.rb', line 10

def preload_translations_for *collections
  RailsDbLocalize::TranslationCache.instance.prefetch_collections(*collections)
end