Sha256: cc9dd0b7efaee20e0fdb2b9981e8a3c82e97a0b97fd361952ce7d7ae3630f19b

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

# encoding: utf-8

module ROM
  class Session
    class State

      # @api private
      class Persisted < self
        include Concord::Public.new(:object, :mapper)

        # @api private
        def save(relation)
          if mapper.dirty?(object)
            Updated.new(object, mapper, relation)
          else
            self
          end
        end

        # @api private
        def delete(relation)
          Deleted.new(object, relation)
        end

      end # Persisted

    end # State
  end # Session
end # ROM

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-session-0.1.1 lib/rom/session/state/persisted.rb
rom-session-0.1.0 lib/rom/session/state/persisted.rb