Serialize chainable queries constructed with ActiveRecord::QueryMethods