Hello guys, i am suggesting this patch to resolve a problem the
inflector in my language in relations has_many.
We have grammar rules that singularize the first word in compounds
words
See how is the singular and plural in my idiom
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'plano_de_contas_base',
'planos_de_contas_base'
inflect.irregular 'plano_de_contas', 'planos_de_contas'
end
I found this solution to singularize correctly
class_name = name.to_s.camelize
output PlanosDeContas
class_name.singularize
output PlanosDeConta
name.to_s.singularize.camelize
output PlanoDeContas, it should be done
has_many example
book-keeper in portuguese
class PlanoDeContas < ActiveRecord::Base
belongs_to :banco
end
bank in portuguese
class Banco < ActiveRecord::Base
has_many :planos_de_contas
end
cheers!