I have a database column given as:
t.column :change_address, :boolean
The user interacts with this using a checkbox, but wants confirmations
Change address: Yes
In an isolated case something like:
@obj.change_address ? ‘Yes’ : ‘No’
Would work fine but this is peppered throughout scads of forms and
fields. The first step I took at DRYing this up was:
But this breaks other uses. For example observe_field constructs the
observers based on the to_s conversion of boolean attributes.
Any ideas on how to DRY this usage up?
View this message in context:
Sent from the RubyOnRails Users forum at Nabble.com.