ginjo / rfm

FileMaker to Ruby adapter.
MIT License
45 stars 22 forks source link

Can -edit save multiple data with max-repeat="3" #44

Closed mech closed 5 years ago

mech commented 5 years ago

I have a field named Bonus that is so-called Repeating like this:

<metadata>
  <field-definition max-repeat="3" name="Bonus" result="text" ... />
</metadata>
...
<record mod-id="123" record-id="122">
  <field name="Bonus">
    <data>one</data>
    <data>two</data>
    <data>three</data>
  </field>
</record>

And RFM return an array conveniently for me.

['one', 'two', 'three']

My question is, how do we save the record back with the -edit query command?

My guess is that it is entirely impossible with the current setup, just want to know anyone over here deal with repeating values.

mech commented 5 years ago

Ok I answer myself. We need to simply use the fully qualified field name as in:

model.update_attributes("Bonus(1)" => 'one', "Bonus(2)" => 'two')