3dna/clots — pull request #1 by sandrasi (2014-03-14 22:34:04+00:00)
Title: Support prefixed custom_values method on the Liquid drops

@kaip @mermel @corwinstephen Could you please review?

The reason for this change is to avoid conflicts between custom fields available on the model a Liquid form is created for (like `Donation`) and the custom fields that are available on the signup to which the model belongs to.

I basically changed only one thing in `ModelFormTags`: the `custom_values` method called on the drop should be prefixed with the first part of the attribute name. For example, to get a signup custom value in the donation form we need to have a Liquid code like this:

```
{% form_for donation %}
...
My awesome signup custom field{% text_field "signup.custom_values.my_awesome_signup_custom_field", class:"text" %}
...
{% endform_for %}
```

For this to work we have to have a method called `signup_custom_fields` on the `DonationDrop` class.

To get a custom value on the actual model, the code remains the same:

```
{% form_for donation %}
...
My awesome donation custom field{% text_field "custom_values.my_awesome_donation_custom_field", class:"text" %}
...
{% endform_for %}

```

Notice that in this case the `custom_values` is not prefixed with anything, so it will simply use the `custom_values` method of the drop.