belongs_to (DataMapper::Model::Relationship)

    # File lib/dm-core/model/relationship.rb, line 162
          def belongs_to(name, *args)
            assert_kind_of 'name', name, Symbol

            model   = extract_model(args)
            options = extract_options(args)

            if options.key?(:through)
              warn "#{self.name}#belongs_to with :through is deprecated, use 'has 1, :#{name}, #{options.inspect}' in #{self.name} instead (#{caller[0]})"
              return has(1, name, model, options)
            end

            assert_valid_options(options)

            if options.key?(:model) && model
              raise ArgumentError, 'should not specify options[:model] if passing the model in the third argument'
            end

            model ||= options.delete(:model)

            repository_name = repository.name

            # TODO: change to source_repository_name and target_respository_name
            options[:child_repository_name]  = repository_name
            options[:parent_repository_name] = options.delete(:repository)

            relationship = relationships(repository_name)[name] = Associations::ManyToOne::Relationship.new(name, self, model, options)

            descendants.each do |descendant|
              descendant.relationships(repository_name)[name] ||= relationship
            end

            relationship
          end