Update fails Rollback?


#1

this is my code

def usermod
User.update(10, :user_level => 3)
end

this is what shows in the console

Processing UserController#usermod (for 127.0.0.1 at 2009-06-02 20:28:38)
[GET]
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
User Load (0.5ms) SELECT * FROM users WHERE (users.id = 10)
User Columns (2.5ms) SHOW FIELDS FROM users
CACHE (0.0ms) SELECT * FROM users WHERE (users.id = 10)
SQL (0.1ms) BEGIN
User Exists (1.7ms) SELECT users.id FROM users WHERE
(users.login = BINARY ‘gorpie’ AND users.id <> 10) LIMIT 1
User Exists (0.5ms) SELECT users.id FROM users WHERE
(users.email = BINARY ‘n’ AND users.id <> 10) LIMIT 1
SQL (0.1ms) ROLLBACK
Rendering template within layouts/application
Rendering user/usermod
Completed in 27ms (View: 10, DB: 6) | 200 OK
[http://localhost/user/usermod]


#2

turns out my validations were angry at the invalid email address in the
account.

blarf.