I can’t find it on ActiveRecord::Base? I assume that it returns a
value based on the column id but I can’t find any documentation on it.
send sends a message to an object. In this case, you’re sending the
name of the column to the object in target_list.
Sending a message is basically equivalent to calling a method. But
since you don’t know the name(s) of the methods in advance (they’re in
the columns), you use send to generalize the process.
It’s a built-in Ruby facility; it’s used in many programs and systems,
not just Rails.
Untested, but I remember having to call a few methods without knowing
their
names first, and used something similar to this… however… send is
probably more aesthetic than any hack I came up with
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.