Sha256: c257f5fadf22d0493e7435190c5c275498567c6c7c5d9c7312faf13ea1717cfe
Contents?: true
Size: 487 Bytes
Versions: 15
Compression:
Stored size: 487 Bytes
Contents
class ModelSet class RawSQLQuery < SQLBaseQuery def sql=(sql) @sql = sanitize_condition(sql) ['LIMIT', 'OFFSET'].each do |term| raise "#{term} not permitted in raw sql" if @sql.match(/ #{term} \d+/i) end end def sql "#{@sql} #{limit_clause}" end def count # The only way to get the count if there is a limit is to fetch all ids without the limit. @count ||= limit ? fetch_id_set(@sql).size : size end end end
Version data entries
15 entries across 15 versions & 2 rubygems