svenfuchs/globalize3 — pull request #202 by ybart (2013-02-22 21:39:08+00:00)
Title: Formtastic inputs for translated attributes don't get type information

The problem
==
I rendered a form using formtastic for a text attribute (not string). Formtastic displays this as a textarea by default. But this does not work for translated attributes, in this case formtastic displays it as a standard text field rather than a textarea.

Discussion
==
To guess type, formtastic relies on ActiveRecord ```column_for_type```, however this method returns nil for translated attributes because it's not overridden.

Workaround
==
The workaround consists in overriding the ```column_for_attribute``` call in the ActiveRecord model and calling the corresponding method defined in Globalize::Adapter (it's a protected method so I called it using send).

```ruby
def column_for_attribute name
translated_attribute_names.include?(name) ? globalize.send(:column_for_attribute, name) : super
end
```

Should this delegation/override be put inside Globalize ? What do you think about this workaround ?