I have array of different object with the same properties
class Report1 < ActiveRecord::Base
end
class Report2< ActiveRecord::Base
end
class Report3< ActiveRecord::Base
end
And I select them like this:
@reports1 = Report1 .where(...)
@reports2 = Report2.where(...)
@reports3 = Report3.where(...)
@reports_all = @reports1 + @reports2 + @reports3
How do I sort it by date field?
I tried to use .sort but got an error that these objects are different types