Sha256: d613ba434e1bc90e63ee0620ad88f1f0f3514c0d065049a63db2bb537a95afc0

Contents?: true

Size: 592 Bytes

Versions: 7

Compression:

Stored size: 592 Bytes

Contents

module ROM
  class Changeset
    module Restricted
      # Return a command restricted by the changeset's relation
      #
      # @see Changeset#command
      #
      # @api private
      def command
        super.new(relation)
      end

      # Restrict changeset's relation by its PK
      #
      # @example
      #   repo.changeset(UpdateUser).by_pk(1).data(name: "Jane")
      #
      # @param [Object] pk
      #
      # @return [Changeset]
      #
      # @api public
      def by_pk(pk, data = EMPTY_HASH)
        new(relation.by_pk(pk), __data__: data)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
rom-changeset-1.0.0.beta2 lib/rom/changeset/restricted.rb
rom-repository-1.4.0 lib/rom/repository/changeset/restricted.rb
rom-changeset-1.0.0.beta1 lib/rom/changeset/restricted.rb
rom-repository-1.3.3 lib/rom/repository/changeset/restricted.rb
rom-repository-1.3.2 lib/rom/repository/changeset/restricted.rb
rom-repository-1.3.1 lib/rom/repository/changeset/restricted.rb
rom-repository-1.3.0 lib/rom/repository/changeset/restricted.rb