lib/redis_assist/finders.rb
def last(limit=1, offset=0)
      from    = offset
      to      = from + limit - 1
      members = redis.zrange(index_key_for(:id), (to * -1) + -1, (from * -1) + -1).reverse

      find(limit > 1 ? members : members.first)
    end
def last(limit=1, offset=0)
      from    = offset
      to      = from + limit - 1
      members = redis.zrange(index_key_for(:id), (to * -1) + -1, (from * -1) + -1).reverse

      find(limit > 1 ? members : members.first)
    end
def last ( limit = 1 , offset = 0 ) from = offset to = from + limit - 1 members = redis . zrange ( index_key_for ( :id ) , ( to * - 1 ) + - 1 , ( from * - 1 ) + - 1 ) . reverse find ( limit > 1 ? members : members . first ) end
Find the first saved record
 @note `last` uses a sorted set as an index of `ids` and finds the highest id.
 @param limit [Integer] returns one or many
 @param offset [Integer] from the end of the index, back
 @return [Base, Array]
Find the first saved record