def find(args = {})
      # when argument is integer - search by id
      args = { id: args } if args.is_a?(Integer)
      #normalize input hash of arguments
      args = HashWithIndifferentAccess.new(args)

      out = []
      klass = self.name.constantize
      search_key = klass.generate_key(args)
      #is key specified directly? -> no needs of looking for other keys! -> faster
      unless search_key =~ /\*/
        out << klass.new_by_key(search_key) if klass.exists?(args)
      else
        RedisModelExtension::Database.redis.keys(search_key).each do |key|
          out << klass.new_by_key(key)
        end
      end
      out
    end
def find(args = {})
      # when argument is integer - search by id
      args = { id: args } if args.is_a?(Integer)
      #normalize input hash of arguments
      args = HashWithIndifferentAccess.new(args)

      out = []
      klass = self.name.constantize
      search_key = klass.generate_key(args)
      #is key specified directly? -> no needs of looking for other keys! -> faster
      unless search_key =~ /\*/
        out << klass.new_by_key(search_key) if klass.exists?(args)
      else
        RedisModelExtension::Database.redis.keys(search_key).each do |key|
          out << klass.new_by_key(key)
        end
      end
      out
    end
FIND METHODS

Find method for searching in redis
 * args (Integer) - search by id
 * args (Hash) - search by arguments in redis_key