lib/scheherazade/character_builder.rb
def build(attribute_list = nil)
      @seq = (story.counter[@model] += 1)
      lists = [required_attributes, *default_attribute_lists, attribute_list]
      lists.prepend [:created_at] if @ar.has_attribute?(:created_at)
      attribute_list = lists.map{|al| canonical(al)}.inject(:merge)
      log(:building, attribute_list)
      set_attributes(attribute_list)
      unless @ar.valid?
        attribute_list = canonical(@ar.errors.map{|attr, _| attr})
        log(:fixing_errors, attribute_list)
        set_attributes(attribute_list)
      end
      yield @ar if block_given?
      log(:final_value, @ar)
      @ar
    end
def build(attribute_list = nil)
      @seq = (story.counter[@model] += 1)
      lists = [required_attributes, *default_attribute_lists, attribute_list]
      lists.prepend [:created_at] if @ar.has_attribute?(:created_at)
      attribute_list = lists.map{|al| canonical(al)}.inject(:merge)
      log(:building, attribute_list)
      set_attributes(attribute_list)
      unless @ar.valid?
        attribute_list = canonical(@ar.errors.map{|attr, _| attr})
        log(:fixing_errors, attribute_list)
        set_attributes(attribute_list)
      end
      yield @ar if block_given?
      log(:final_value, @ar)
      @ar
    end
Note: must be equal? to AUTO (i.e. same object), not just ==
 builds a character, filling required attributes,
 default attributes for this type of character and
 the attributes given.

 If the built object is invalid, the attributes with
 errors will also be filled.

 An invalid object may be returned. In particular, it is
 possible that it is only invalid because an associated
 model is not yet valid.