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.



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

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

Instance Method Details

#closeObject



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

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

#each(&block) ⇒ Object



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

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