Skip to content
Snippets Groups Projects
Commit 8c6c4677 authored by Pavel's avatar Pavel
Browse files

Fixed delete() method

parent c20760d9
No related branches found
No related tags found
No related merge requests found
...@@ -450,6 +450,11 @@ module ActiveRecord ...@@ -450,6 +450,11 @@ module ActiveRecord
result.last_insert_id result.last_insert_id
end end
def delete(arel, name = nil, binds = [])
res = super(arel, name, binds)
res.affected_rows
end
# Begins the transaction. # Begins the transaction.
def begin_db_transaction def begin_db_transaction
hdl = execute("START TRANSACTION") hdl = execute("START TRANSACTION")
...@@ -501,7 +506,7 @@ module ActiveRecord ...@@ -501,7 +506,7 @@ module ActiveRecord
#=======END=OF=DATABASE=STATEMENTS=========# #=======END=OF=DATABASE=STATEMENTS=========#
protected
# restructure result returned by execute # restructure result returned by execute
def process_hdl(hdl) def process_hdl(hdl)
result = [] result = []
...@@ -536,8 +541,7 @@ module ActiveRecord ...@@ -536,8 +541,7 @@ module ActiveRecord
# Executes the update statement and returns the number of rows affected. # Executes the update statement and returns the number of rows affected.
def update_sql(sql, name = nil) def update_sql(sql, name = nil)
hdl = execute(sql,name) hdl = execute(sql,name)
# affected_rows = hdl.affected_rows hdl.affected_rows
return false
end end
# Returns the last auto-generated ID from the affected table. # Returns the last auto-generated ID from the affected table.
...@@ -549,9 +553,10 @@ module ActiveRecord ...@@ -549,9 +553,10 @@ module ActiveRecord
# table_name = extract_table_name_from_insertion_query(sql) # table_name = extract_table_name_from_insertion_query(sql)
# make_sure_pk_works(table_name,name) # make_sure_pk_works(table_name,name)
hdl = execute(sql, name) hdl = execute(sql, name)
# last_auto_generated_id = hdl.get_last_auto_generated_id hdl.last_insert_id
end end
protected
# Some tests insert some tuples with the id values set. In other words, the sequence # Some tests insert some tuples with the id values set. In other words, the sequence
# is not used to generate a value for the primary key column named id. When a new tuple # is not used to generate a value for the primary key column named id. When a new tuple
# it to be inserted, where the id value is not set explicitly, a primary key violation will # it to be inserted, where the id value is not set explicitly, a primary key violation will
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment