Nested Wrong Translation Inflection

0

Opa,

The problem is as follows: I have a Model Call Idea and I am trying to add a new nested in it to IdeaCategory which is an associative with Idea. Then we have:

Idea:
has_many: idea_categories, inverse_of:: idea, dependent:: destroy
accepts_nested_attributes_for: idea_categories,: reject_if = > : all_blank,: allow_destroy = > true

IdeaCategory:
belongs_to: idea
belongs_to: category

Category:
has_many: idea_categories, inverse_of:: category, dependent:: destroy

In my Idea form I have this:

And when I enter this form I get the error:

Andinmyinflectionisthispartoftheideas:

inflect.plural"ideia_comentario", "ideia_comentarios"
inflect.singular "ideia_comentarios", "ideia_comentario"

inflect.plural "ideia_arquivo", "ideia_arquivos"
inflect.singular "ideia_arquivos", "ideia_arquivo"

inflect.plural "ideia_categoria", "ideia_categorias"
inflect.singular "ideia_categorias", "ideia_categoria"

inflect.plural "categoria", "categorias"
inflect.singular "categorias", "categoria"

Where are you pulling this IdeiaCategorium?

    
asked by anonymous 09.04.2017 / 03:34

1 answer

0

Here's a hint of how to put in your inflections file:

ActiveSupport::Inflector.inflections do |inflect|
  inflect.clear

  inflect.plural(/$/,  's')
  inflect.plural(/(s)$/i,  '')
  inflect.plural(/^(paí)s$/i, 'ses')
  inflect.plural(/(z|r)$/i, 'es')
  inflect.plural(/al$/i,  'ais')
  inflect.plural(/el$/i,  'eis')
  inflect.plural(/ol$/i,  'ois')
  inflect.plural(/ul$/i,  'uis')
  inflect.plural(/([^aeou])il$/i,  'is')
  inflect.plural(/m$/i,   'ns')
  inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i,  'eses')
  inflect.plural(/^(|g)ás$/i,  'ases')
  inflect.plural(/ão$/i,  'ões')
  inflect.plural(/^(irm|m)ão$/i,  'ãos')
  inflect.plural(/^(alem|c|p)ão$/i,  'ães')

  # Sem acentos...
  inflect.plural(/ao$/i,  'oes')
  inflect.plural(/mês$/i,  'meses')
  inflect.plural(/^(irm|m)ao$/i,  'aos')
  inflect.plural(/^(alem|c|p)ao$/i,  'aes')

  inflect.singular(/([^ê])s$/i, '')
  inflect.singular(/^(á|gá|paí)s$/i, 's')
  inflect.singular(/(r|z)es$/i, '')
  inflect.singular(/([^p])ais$/i, 'al')
  inflect.singular(/eis$/i, 'el')
  inflect.singular(/ois$/i, 'ol')
  inflect.singular(/uis$/i, 'ul')
  inflect.singular(/(r|t|f|v)is$/i, 'il')
  inflect.singular(/ns$/i, 'm')
  inflect.singular(/sses$/i, 'sse')
  inflect.singular(/^(.*[^s]s)es$/i, '')
  inflect.singular(/ães$/i, 'ão')
  inflect.singular(/aes$/i, 'ao')
  inflect.singular(/ãos$/i, 'ão')
  inflect.singular(/aos$/i, 'ao')
  inflect.singular(/ões$/i, 'ão')
  inflect.singular(/oes$/i, 'ao')
  inflect.singular(/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i, 'ês')
  inflect.singular(/^(g|)ases$/i,  'ás')
  inflect.irregular('palavra_chave', 'palavras_chaves')
  inflect.irregular('joao_ninguem', 'jooes_ninguem')
end

The last two lines are in case you want to put plural in the two words as would be the case of the plural of a compound noun.

    
14.07.2017 / 18:45