lib/redis-model-extension/initialize.rb
def redis_alias name, main_fields, name_of_field_for_order = nil, name_of_field_for_args = nil
      #set fields if they are not allready set!
      if name_of_field_for_order && name_of_field_for_args
        redis_field name_of_field_for_order, :array, [] unless redis_fields_config.has_key?(name_of_field_for_order)
        redis_field name_of_field_for_args, :hash, {} unless redis_fields_config.has_key?(name_of_field_for_args)
      end

      @redis_alias_config ||= {}
      #add specification of dynamic alias
      @redis_alias_config[name] = { 
        main_fields: main_fields,
        order_field: name_of_field_for_order,
        args_field: name_of_field_for_args,
      }

      #create alias methods for find and get (find_by_name, get_by_name)
      create_class_alias_method(name)
    end
def redis_alias name, main_fields, name_of_field_for_order = nil, name_of_field_for_args = nil
      #set fields if they are not allready set!
      if name_of_field_for_order && name_of_field_for_args
        redis_field name_of_field_for_order, :array, [] unless redis_fields_config.has_key?(name_of_field_for_order)
        redis_field name_of_field_for_args, :hash, {} unless redis_fields_config.has_key?(name_of_field_for_args)
      end

      @redis_alias_config ||= {}
      #add specification of dynamic alias
      @redis_alias_config[name] = { 
        main_fields: main_fields,
        order_field: name_of_field_for_order,
        args_field: name_of_field_for_args,
      }

      #create alias methods for find and get (find_by_name, get_by_name)
      create_class_alias_method(name)
    end
store informations about redis aliases