2

我正在研究返回 false 的模型“update_attributes”,但 model.errors.messages.inspect 返回 {}。没有错误,只是事务回滚。以下是日志:

===========>>>>>>>>>>> @user.errors.messages.inspect ======
{}


Started PUT "/authentify/users/4" for 127.0.0.1 at 2012-12-20 00:01:57 -0600
Processing by Authentify::UsersController#update as HTML
  Parameters: {"utf8"=>"√", "authenticity_token"=>"Y01zI3oQmccemTJvBnHmff04w4raAcBLwdQ2k69wKjM=", "user"=>{"name"=>"Janexx", "login"=>"amine4", "update_password_checkbox"=>"[FILTERED]", "status"=>"active", "user_levels_attributes"=>{"0"=>{"sys_user_group_id"=>"admin", "manager_id"=>"admin", "id"=>"4"}}}, "commit"=>"Save", "id"=>"4"}
  Authentify::User Load (0.0ms)  SELECT "authentify_users".* FROM "authentify_users" WHERE "authentify_users"."id" = ? LIMIT 1  [["id", 1]]
  Authentify::Session Load (0.0ms)  SELECT "authentify_sessions".* FROM "authentify_sessions" LIMIT 1
  CACHE (0.0ms)  SELECT "authentify_sessions".* FROM "authentify_sessions" LIMIT 1
  Authentify::User Load (0.0ms)  SELECT "authentify_users".* FROM "authentify_users" WHERE "authentify_users"."id" = ? LIMIT 1  [["id", "4"]]
   (0.0ms)  begin transaction
  Authentify::UserLevel Load (0.0ms)  SELECT "authentify_user_levels".* FROM "authentify_user_levels" WHERE "authentify_user_levels"."user_id" = 4 AND "authentify_user_levels"."id" IN (4)
   (1.0ms)  UPDATE "authentify_users" SET "name" = 'Janexx', "updated_at" = '2012-12-20 06:01:57.100454' WHERE "authentify_users"."id" = 4
   (3.0ms)  rollback transaction
{}
4

0 回答 0