Displaying 1 result from an estimated 1 matches for "schemeaccountfield".
2006 Apr 11
1
Mixins?
...ectory:
module FieldHelper
def validate_field
if template_field.mandatory? && (!field_value || field_value.length==0)
errors.add(template_field.name, _(''cant.be.blank''))
end
end
end
Now in the model I have this :
require "field_helper"
class SchemeAccountField < ActiveRecord::Base
include FieldHelper
protected
def validate
validate_field
end
end
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 someth...