lib/redis-model-extension/get_find.rb
def get_by_alias(alias_name, args = {})
      #check if asked dynamic alias exists
      raise ArgumentError, "Unknown dynamic alias: '#{alias_name}', use: #{redis_alias_config.keys.join(", ")} " unless redis_alias_config.has_key?(alias_name.to_sym)

      #normalize input hash of arguments
      args = HashWithIndifferentAccess.new(args)

      klass = self.name.constantize
      if klass.valid_alias_key?(alias_name, args) && klass.alias_exists?(alias_name, args)
        out = []
        RedisModelExtension::Database.redis.smembers(klass.generate_alias_key(alias_name, args)).each do |key|
          item = klass.new_by_key(key)
          out << item if item
        end
        return out
      end
      nil
    end
def get_by_alias(alias_name, args = {})
      #check if asked dynamic alias exists
      raise ArgumentError, "Unknown dynamic alias: '#{alias_name}', use: #{redis_alias_config.keys.join(", ")} " unless redis_alias_config.has_key?(alias_name.to_sym)

      #normalize input hash of arguments
      args = HashWithIndifferentAccess.new(args)

      klass = self.name.constantize
      if klass.valid_alias_key?(alias_name, args) && klass.alias_exists?(alias_name, args)
        out = []
        RedisModelExtension::Database.redis.smembers(klass.generate_alias_key(alias_name, args)).each do |key|
          item = klass.new_by_key(key)
          out << item if item
        end
        return out
      end
      nil
    end
GET BY REDIS KEYS

fastest method to get object from redis by getting it by dynamic alias and arguments