Puedes usar cmd_tuples
método:
sql = "UPDATE users SET updated_at = '#{DateTime.now}' WHERE id = 1"
ActiveRecord::Base.connection.execute(sql).cmd_tuples
# => 1
Documentación:http://www.rubydoc.info/gems /pg/0.17.1/PG%2FResult:cmd_tuples
Puedes usar cmd_tuples
método:
sql = "UPDATE users SET updated_at = '#{DateTime.now}' WHERE id = 1"
ActiveRecord::Base.connection.execute(sql).cmd_tuples
# => 1
Documentación:http://www.rubydoc.info/gems /pg/0.17.1/PG%2FResult:cmd_tuples