Loading validations from a table
I need to load model validations from a table and validate my model. e.g.
I have a database table called validations, which has rows like :
validation_action validation_condition
---------------- --------------------
validates_presence_of if answer_name is name
validates_format_of if answer_type is date
In my model I want:
class Model < ActiveRecord::Base
load validation_actions , lambda {if validation_condition is true}
No comments:
Post a Comment