Sha256: f572ad157de20fc4a4dadc06b0b6f6c118534c4bd79b04a67a4f5543301cf855

Contents?: true

Size: 436 Bytes

Versions: 31

Compression:

Stored size: 436 Bytes

Contents

# encoding: utf-8
module Mongoid # :nodoc:
  module Relations #:nodoc:
    module Cascading #:nodoc:
      class Nullify < Strategy

        # This cascade does not delete the referenced relations, but instead
        # sets the foreign key values to nil.
        #
        # @example Nullify the reference.
        #   strategy.cascade
        def cascade
          relation.nullify if relation
        end
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 3 rubygems

Version Path
mongoid-multi-db-3.0.0 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.6 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.5 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.4.0 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.5 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.4 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.4 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.3 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.2 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.3 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.1 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.3.0 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.2 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.1 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.2.0 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.1.9 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.1.8 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.1.7 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.1.6 lib/mongoid/relations/cascading/nullify.rb
mongoid-2.1.5 lib/mongoid/relations/cascading/nullify.rb