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

Fixed delete() method

parent c20760d9
Branches
No related tags found
No related merge requests found
......@@ -450,6 +450,11 @@ module ActiveRecord
result.last_insert_id
end
def delete(arel, name = nil, binds = [])
res = super(arel, name, binds)
res.affected_rows
end
# Begins the transaction.
def begin_db_transaction
hdl = execute("START TRANSACTION")
......@@ -501,7 +506,7 @@ module ActiveRecord
#=======END=OF=DATABASE=STATEMENTS=========#
protected
# restructure result returned by execute
def process_hdl(hdl)
result = []
......@@ -536,8 +541,7 @@ module ActiveRecord
# Executes the update statement and returns the number of rows affected.
def update_sql(sql, name = nil)
hdl = execute(sql,name)
# affected_rows = hdl.affected_rows
return false
hdl.affected_rows
end
# Returns the last auto-generated ID from the affected table.
......@@ -549,9 +553,10 @@ module ActiveRecord
# table_name = extract_table_name_from_insertion_query(sql)
# make_sure_pk_works(table_name,name)
hdl = execute(sql, name)
# last_auto_generated_id = hdl.get_last_auto_generated_id
hdl.last_insert_id
end
protected
# 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
# 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