diff options
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index fb54642d3a..359cb067a2 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -64,8 +64,13 @@ module ActiveRecord log(sql, name, @connection) { |connection| connection.query(sql) } end - alias_method :update, :execute - alias_method :delete, :execute + def update(sql, name = nil) + result = nil + log(sql, name, @connection) { |connection| result = connection.exec(sql) } + result.cmdtuples + end + + alias_method :delete, :update def begin_db_transaction() execute "BEGIN" end def commit_db_transaction() execute "COMMIT" end |