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

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(target, original) ⇒ Body

Returns a new instance of Body.



128
129
130
131
# File 'activerecord/lib/active_record/identity_map.rb', line 128

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

Instance Method Details

#closeObject



137
138
139
140
141
142
# File 'activerecord/lib/active_record/identity_map.rb', line 137

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

#each(&block) ⇒ Object



133
134
135
# File 'activerecord/lib/active_record/identity_map.rb', line 133

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