hmm also if there's no data, Inflector::foo is called twice. I suggest using a whitelist or configured key => value pair (possibly defined from model association information) rather than deriving based upon the presence of data.

Alternatively: Given how frequently this method will be called on large data sets - might it be worth caching these inflector calls?