Move private method to a more reusable location
This method will be used by any translatable model that uses pg_search feature so it's better to have it within globalizable model concern so all translatable models can use it.
This commit is contained in:
committed by
voodoorai2000
parent
036a3d7636
commit
ed750f6cce
@@ -20,6 +20,18 @@ module Globalizable
|
||||
if self.paranoid? && translation_class.attribute_names.include?("hidden_at")
|
||||
translation_class.send :acts_as_paranoid, column: :hidden_at
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def searchable_globalized_values
|
||||
values = {}
|
||||
translations.each do |translation|
|
||||
Globalize.with_locale(translation.locale) do
|
||||
values.merge! searchable_translations_definitions
|
||||
end
|
||||
end
|
||||
values
|
||||
end
|
||||
end
|
||||
|
||||
class_methods do
|
||||
|
||||
Reference in New Issue
Block a user