lib/redis-model-extension/initialize.rb
def redis_key *fields
      @redis_key_config = fields.flatten
      
      validate_redis_key
      
      #own specification of redis key - delete autoincrement
      remove_redis_autoincrement_key unless redis_user_field_config.include?(:id) || @redis_key_config.include?(:id)

      # automaticaly add all fields from key to validation
      # if any of fields in redis key is nil
      # then prevent to save it
      @redis_key_config.each do |field|
        validates field, :presence => :true if field != :id
      end
    end
def redis_key *fields
      @redis_key_config = fields.flatten
      
      validate_redis_key
      
      #own specification of redis key - delete autoincrement
      remove_redis_autoincrement_key unless redis_user_field_config.include?(:id) || @redis_key_config.include?(:id)

      # automaticaly add all fields from key to validation
      # if any of fields in redis key is nil
      # then prevent to save it
      @redis_key_config.each do |field|
        validates field, :presence => :true if field != :id
      end
    end
set redis key which will be used for storing model