Sha256: cfe7960eabcae0554f781892494bb18d7bb0c7eea3edcda92f09c1b805acc16b
Contents?: true
Size: 721 Bytes
Versions: 15
Compression:
Stored size: 721 Bytes
Contents
class ModelSet class RawQuery < Query attr_reader :records def anchor!(query, raw_method = 'find_raw_by_id') @records = model_class.send(raw_method, query.ids.to_a) end def select!(&block) records.select!(&block) end def reject!(&block) records.reject!(&block) end def sort_by!(&block) @records = records.sort_by(&block) end def ids if limit (records[offset, limit] || []).collect {|r| r['id'].to_i} else records.collect {|r| r['id'].to_i} end end def size if limit [count - offset, limit].min else count end end def count records.size end end end
Version data entries
15 entries across 15 versions & 2 rubygems