Just writing this so i can remind if i need it again 🙂 I’m in the middle of creating a generic flexible domain modeling module (i call it flexi-model).
In brief flexi-model is schema less flexible modeling tool. It can store your data of any kinda it does trick just providing generic value method and pick up the right column type from preset column definition from model class.
Just to make it easier to grasp here is a sample code –
I’ve the following structure in –
[Collection - for dynamic schema] -< [Record] -< [Value]
On the form I’m using
f.datetime_select :value where (f denotes fields_for of Value instance)
after submission rails was trying to figure out what is :value column in table definition.
since it’s not an existing column so rails was throwing up MultiparameterAssignmentErrors error.
Just after digging bit deep it looks like
read_value_from_parameters is responsible for loading real column definition.
So to mock it i’ve added the following code and it works –
thants all 🙂