DataMapper::Constraints::Relationship::ManyToMany

Private Instance Methods

assert_valid_constraint() click to toggle source

Checks that the constraint type is appropriate to the relationship

@param [Fixnum] cardinality

  cardinality of relationship

@param [Symbol] name

  name of relationship to evaluate constraint of

@param [Hash] options

  options hash

@option *args :constraint[Symbol]

  one of VALID_CONSTRAINT_VALUES

@raise ArgumentError

  if @option :constraint is not one of VALID_CONSTRAINT_TYPES

@return [Undefined]

@api private

    # File lib/data_mapper/constraints/relationship/many_to_many.rb, line 32
32:         def assert_valid_constraint
33:           super
34: 
35:           # TODO: is any constraint valid for a m:m relationship?
36:           if @constraint == :set_nil
37:             raise ArgumentError, "#{@constraint} is not a valid constraint type for #{self.class}"
38:           end
39:         end
one_to_many_options() click to toggle source
    # File lib/data_mapper/constraints/relationship/many_to_many.rb, line 10
10:         def one_to_many_options
11:           super.merge(:constraint => @constraint)
12:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.