diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index 8a77cb0ce7..604fc960aa 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -62,8 +62,16 @@ module ActiveRecord end end - alias_method :update, :execute - alias_method :delete, :execute + def update(sql, name = nil) + execute(sql, name) + @connection.changes + end + + def delete(sql, name = nil) + sql += " WHERE 1=1" unless sql =~ /WHERE/i + execute(sql, name) + @connection.changes + end def begin_db_transaction() execute "BEGIN" end def commit_db_transaction() execute "COMMIT" end |