Class: Collavre::InboxItem

Inherits:
ApplicationRecord show all
Defined in:
app/models/collavre/inbox_item.rb

Constant Summary collapse

INTERPOLATION_PATTERN =
/%%|%\{([\w|]+)\}|%<(\w+)>[^\d]*?\d*\.?\d*[bBdiouxXeEfgGcps]/.freeze

Instance Method Summary collapse

Instance Method Details

#localized_message(locale: I18n.locale) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/collavre/inbox_item.rb', line 25

def localized_message(locale: I18n.locale)
  msg =
    if message_key.present?
      params = message_params || {}
      translate_message(message_key, params.symbolize_keys, locale: locale)
    else
      message
    end

  msg&.gsub("&nbsp;", " ")&.gsub("\u00A0", " ")
end

#to_partial_pathObject

Use non-namespaced partial path for backward compatibility



6
7
8
# File 'app/models/collavre/inbox_item.rb', line 6

def to_partial_path
  "inbox_items/inbox_item"
end