How do I make RoR select option name and id concatenations of other fields?
<p>I”m using Rails 4.2.3.  I have a relation that returns certain columns …</p>

<pre><code>MyObject.joins(:distance_unit)
    .where(["user_id = ?", user.id])
    .select("distance, distance_units.id, distance_units.abbrev")
</code></pre>

<p>This data is meant to be used in a select menu …</p>

<pre><code>&lt;%= select_tag "distance", options_from_collection_for_select(@distance_options, "distance", "distance") %&gt;
</code></pre>

<p>However, what I want is for the id to be a concatenation of the “distance” and “distance_units.id” fields and the option name to be a concatenation of the “distance” and “distance_unit.abbrev” fields.  How do I do that in Rails?</p>