Joined February 2012
·

kuboon

Magician Geek at HeartRails
·
Tokyo, Japan
·
·
·

Posted to ActiveRecord UNION hack over 1 year ago

how about this way?
'''
module UnionHack
def union(relations)
from '((' + relations.map { |r| r.ast.tosql }.join(') UNION (') + ')) AS ' + self.tablename
end
end
'''

and, in your method "my_timeline" you should not do "Profile.union..." but "Event.union..."?

Achievements
19 Karma
0 Total ProTip Views