def add_entity(entity_name, entity_options, activity_klass)
      entity_name = entity_name.to_sym

      if @entity_classes[entity_name] && (@entity_classes[entity_name].name != entity_options[:class].name)
        # otherwise this would break timeline entries deletion mecanism
        raise "Entity name #{entity_name} already used with class #{@entity_classes[entity_name]}, can't redefine it with class #{entity_options[:class]}"
      end

      # class for entity
      @entity_classes[entity_name] = entity_options[:class]

      # entities for activity
      @activity_entities[activity_klass] ||= [ ]
      @activity_entities[activity_klass] << entity_name

      # entities
      @entities ||= { }
      @entities[entity_name] ||= { }

      if !@entities[entity_name][activity_klass].blank?
        raise "Entity name #{entity_name} already used for activity: #{activity_klass}"
      end

      @entities[entity_name][activity_klass] = entity_options
    end
def add_entity(entity_name, entity_options, activity_klass)
      entity_name = entity_name.to_sym

      if @entity_classes[entity_name] && (@entity_classes[entity_name].name != entity_options[:class].name)
        # otherwise this would break timeline entries deletion mecanism
        raise "Entity name #{entity_name} already used with class #{@entity_classes[entity_name]}, can't redefine it with class #{entity_options[:class]}"
      end

      # class for entity
      @entity_classes[entity_name] = entity_options[:class]

      # entities for activity
      @activity_entities[activity_klass] ||= [ ]
      @activity_entities[activity_klass] << entity_name

      # entities
      @entities ||= { }
      @entities[entity_name] ||= { }

      if !@entities[entity_name][activity_klass].blank?
        raise "Entity name #{entity_name} already used for activity: #{activity_klass}"
      end

      @entities[entity_name][activity_klass] = entity_options
    end
Register an entity

 @param entity_name    [Symbol] Entity name
 @param entity_options [Hash]   Entity options
 @param activity_klass [Class]  Activity class that uses that entity