As is often the case when I tackle a new platform/language, I get the
picture very quickly (because frameworks are frameworks are frameworks)
its the nitty-gritty of the language that bogs me down…
So I have some similar methods on a few of my model classes that I
push into a helper. Now I reckoned that the Ruby way was to create a
and mix it in with include. However, I can’t get it to work
In the first instance I put it straight into the models directory:
if template_field.mandatory? && (!field_value ||
Now in the model I have this :
class SchemeAccountField < ActiveRecord::Base
So basically I want to mix in very similar validation rules.
However, what I get is:
undefined local variable or method `validate_field’ for …
I’m obviously missing something obvious and/or being stupid but that’s
nature of the game with a new language I suppose.
Any help out there?