Helpers in Models

I have an app that relies on a series of helpers to generate language
specific text strings for all output.

In one of my models I have to save one of these language specific
strings to the table.
Therefore I’ve started investigating how I can accesss my helpers in my
model - I know this is not best practise, but its the only way I can see
to make this work.

I know of the solution with including the helper in the model like this:

class Employee < ActiveRecord::Base
include LanguageHelper
end

But this is not that good performance wise?

How do I reach my helpers in the model in a more efficient way?
Or can I construct my code in a more correct way?

Best regards
Rudi

Rudi W. wrote:

Therefore I’ve started investigating how I can accesss my helpers in my
model - I know this is not best practise, but its the only way I can see
to make this work.

So your idea here is to fix a bad practice by using an even worse
practice?

How do I reach my helpers in the model in a more efficient way?
Or can I construct my code in a more correct way?

Dealing with languages is a view specific tasks. Models should not be
concerned with language specific issues, In my view the pain this is
giving you should be viewed like a “toothache.” Your code is trying to
tell you something is fundamentally wrong. Using pain relievers, might
get you by for a time, but eventually the problem will need to be
addresses at the source.

However, if you have code that needs to be shared between the MVC layers
it’s common practice to put that code in modules inside the lib
directory, which is provided for just this sort of sharing. That doesn’t
mean, however, that lib is intended to be a “free zone” where rules of
MVC don’t matter and you’re free to break it at will.