Add union_scope as an ActiveRecord extension.