What’s the difference between to_a and to_ary in ActiveRecord?
What’s the difference between
to_a, when called on an object returns an array representation of obj
An array can also be created by using the Array() method, provided by Kernel, which tries to call to_ary, then to_a on its argument. http://ruby-doc.org/core-2.0/Array.html#method-i-to_ary
so as far as I can see, the Array#to_ary src just returns the array that is passed in, as in
if I understand correctly, to_a is used for array conversion and makes its final return using to_ary. But this may not be true in future versions according to apidock
to_a Returns an array representation of obj. For objects of class Object and others that don’t explicitly override the method, the return value is an array containing self. However, this latter behavior will soon be obsolete. http://apidock.com/ruby/Object/to_a