Skip to content

Commit 2de6c30

Browse files
committed
Remove execute since it's defined in AR abstract class, only raw_execute is needed
1 parent 9286d6c commit 2de6c30

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

lib/arjdbc/abstract/database_statements.rb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,6 @@ def exec_update(sql, name = 'SQL', binds = NO_BINDS)
7878
end
7979
alias :exec_delete :exec_update
8080

81-
def execute(sql, name = nil, async: false, allow_retry: false, materialize_transactions: true)
82-
sql = transform_query(sql)
83-
84-
if preventing_writes? && write_query?(sql)
85-
raise ActiveRecord::ReadOnlyError, "Write query attempted while in readonly mode: #{sql}"
86-
end
87-
88-
mark_transaction_written_if_write(sql)
89-
90-
raw_execute(sql, name, async: async, allow_retry: allow_retry, materialize_transactions: materialize_transactions)
91-
end
92-
9381
# overridden to support legacy binds
9482
def select_all(arel, name = nil, binds = NO_BINDS, preparable: nil, async: false)
9583
binds = convert_legacy_binds_to_attributes(binds) if binds.first.is_a?(Array)
@@ -107,7 +95,9 @@ def convert_legacy_binds_to_attributes(binds)
10795
def raw_execute(sql, name, async: false, allow_retry: false, materialize_transactions: true)
10896
log(sql, name, async: async) do
10997
with_raw_connection(allow_retry: allow_retry, materialize_transactions: materialize_transactions) do |conn|
110-
conn.execute(sql)
98+
result = conn.execute(sql)
99+
verified!
100+
result
111101
end
112102
end
113103
end

0 commit comments

Comments
 (0)