Sha256: ea0f3d0aad7fe124857295f72e8e7bd8b4775744cd00c7cc192a05e4226055db

Contents?: true

Size: 939 Bytes

Versions: 14

Compression:

Stored size: 939 Bytes

Contents

# encoding: utf-8
module Mongoid
  module Association
    module Referenced
      class HasMany

        # Binding class for has_many associations.
        class Binding
          include Bindable

          # Binds a single document with the inverse relation. Used
          # specifically when appending to the proxy.
          #
          # @example Bind one document.
          #   person.posts.bind_one(post)
          #
          # @since 2.0.0.rc.1
          def bind_one(doc)
            binding do
              bind_from_relational_parent(doc)
            end
          end

          # Unbind a single document.
          #
          # @example Unbind the document.
          #   person.posts.unbind_one(document)
          #
          # @since 2.0.0.rc.1
          def unbind_one(doc)
            binding do
              unbind_from_relational_parent(doc)
            end
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mongoid-7.0.13 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.12 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.11 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.10 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.8 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.7 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.6 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.5 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.4 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.3 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.2 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.1 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.0 lib/mongoid/association/referenced/has_many/binding.rb
mongoid-7.0.0.beta lib/mongoid/association/referenced/has_many/binding.rb