Skip to content

Commit 2acf099

Browse files
author
Carlos Silva
committed
Fix problem with prepared statement
1 parent 496f8bb commit 2acf099

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/torque/postgresql/associations/association.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def inversed_from(record)
1111
@inversed = self.target.present?
1212
end
1313

14+
def skip_statement_cache?(*)
15+
super || reflection.connected_through_array?
16+
end
17+
1418
private
1519

1620
def set_owner_attributes(record)

lib/torque/postgresql/associations/preloader/association.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def run_array_for_has_many
3333
ids.each { |id| records[id].concat(Array.wrap(record)) }
3434
end
3535

36+
records.default_proc = nil
3637
owners.each do |owner|
3738
associate_records_to_owner(owner, records[owner[owner_key_name]] || [])
3839
end

lib/torque/postgresql/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Torque
22
module PostgreSQL
3-
VERSION = '1.1.7'
3+
VERSION = '1.1.8'
44
end
55
end

0 commit comments

Comments
 (0)