new (DataMapper::Associations::Relationship)

    # File lib/dm-core/associations/relationship.rb, line 432
          def initialize(name, child_model, parent_model, options = {})
            initialize_object_ivar('child_model',  child_model)
            initialize_object_ivar('parent_model', parent_model)

            @name                   = name
            @instance_variable_name = "@#{@name}".freeze
            @options                = options.dup.freeze
            @child_repository_name  = @options[:child_repository_name]
            @parent_repository_name = @options[:parent_repository_name]
            @child_properties       = @options[:child_key].try_dup.freeze
            @parent_properties      = @options[:parent_key].try_dup.freeze
            @min                    = @options[:min]
            @max                    = @options[:max]
            @reader_visibility      = @options.fetch(:reader_visibility, :public)
            @writer_visibility      = @options.fetch(:writer_visibility, :public)

            # TODO: normalize the @query to become :conditions => AndOperation
            #  - Property/Relationship/Path should be left alone
            #  - Symbol/String keys should become a Property, scoped to the target_repository and target_model
            #  - Extract subject (target) from Operator
            #    - subject should be processed same as above
            #  - each subject should be transformed into AbstractComparison
            #    object with the subject, operator and value
            #  - transform into an AndOperation object, and return the
            #    query as :condition => and_object from self.query
            #  - this should provide the best performance

            @query = @options.except(*self.class::OPTIONS).freeze

            create_reader
            create_writer
          end