a and b are ActiveRecord :: Relation objects that return objects of the same type (Micropost objects in this case)
a.class => ActiveRecord::Relation b.class => ActiveRecord::Relation a.first => Micropost(...) b.first => Micropost(...)
Is there an OR way for both Relation objects and returning another Relation object in Rails 3.2.11? Do I need to use some kind of stone, for example squeel , to do this?
If this is not possible: why is it impossible? Can I split an array into a|b array without loading each record from the database?
If this can be done: can someone write an example of how to do this?
Thanks in advance.
EDIT: I copied the wrong variables into a code block, b was not ActiveRecord :: Relation, it was actually an array, and that is why a.merge (b) returned []. My mistake.
TL; DR: the question is incorrect and the array may be paginated :)
source share