Class: ActiveRecord::IdentityMap::Middleware::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/identity_map.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(target, original) ⇒ Body

Returns a new instance of Body.



134
135
136
137
# File 'lib/active_record/identity_map.rb', line 134

def initialize(target, original)
  @target   = target
  @original = original
end

Instance Method Details

#closeObject



143
144
145
146
147
148
# File 'lib/active_record/identity_map.rb', line 143

def close
  @target.close if @target.respond_to?(:close)
ensure
  IdentityMap.enabled = @original
  IdentityMap.clear
end

#each(&block) ⇒ Object



139
140
141
# File 'lib/active_record/identity_map.rb', line 139

def each(&block)
  @target.each(&block)
end