Method: Modis::Finder::ClassMethods#all
- Defined in:
- lib/modis/finder.rb
#all ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/modis/finder.rb', line 15 def all unless all_index_enabled? raise IndexError, "Unable to retrieve all records of #{name}, "\ "because you disabled all index. See :enable_all_index for more." end records = Modis.with_connection(modis_connection) do |redis| ids = redis.smembers(key_for(:all)) redis.pipelined do |pipeline| ids.map { |id| record_for(pipeline, id) } end end records_to_models(records) end |