We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e8dd76 commit 829873fCopy full SHA for 829873f
lib/postgresql_cursor/cursor.rb
@@ -110,7 +110,12 @@ def each_array(&block)
110
def each_instance(klass=nil, &block)
111
klass ||= @type
112
self.each_tuple do |row|
113
- klass.send(:instantiate, row)
+ if ::ActiveRecord::VERSION::MAJOR < 4
114
+ model = klass.send(:instantiate,row)
115
+ else
116
+ @column_types ||= column_types
117
+ model = klass.send(:instantiate, row, @column_types)
118
+ end
119
block.call(model)
120
end
121
@@ -139,7 +144,12 @@ def each_instance_batch(klass=nil, &block)
139
144
140
145
self.each_batch do |batch|
141
146
models = batch.map do |row|
142
147
148
+ model = klass.send(:instantiate, row)
149
150
151
152
143
153
154
block.call(models)
155
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments