0

根据rails guides所说ActiveRecord::AssociationTypeMismatch,只有在关联不匹配时才应该提出,但在我的情况下它是新的..

以下是例外:

ActiveRecord::AssociationTypeMismatch (Service(#50963840) expected, got Service(#70493480)):

参数跟踪:

  Parameters: {"utf8"=>"✓", "authenticity_token"=>"EyilRRem8MLjCrIGq5aovntlrWpCnVBbq/v0tO1HpD4=", "room"=>{"name"=>"room1", "service_ids"=>["2", "3", "4"], "location_id"=>"25", "capacity"=>"2"}, "multiselect_room_service_ids"=>"4", "commit"=>"Update Room", "id"=>"3"}
Creating scope :page. Overwriting existing method AdminUser.page.
  AdminUser Load (0.2ms)  SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 1 LIMIT 1
  Room Load (0.2ms)  SELECT `rooms`.* FROM `rooms` WHERE `rooms`.`id` = 3 LIMIT 1
  Service Load (0.2ms)  SELECT `services`.* FROM `services` WHERE `services`.`id` IN (2, 3, 4)
  Service Load (0.1ms)  SELECT `services`.* FROM `services` INNER JOIN `service_rooms` ON `services`.`id` = `service_rooms`.`service_id` WHERE `service_rooms`.`room_id` = 3 AND (is_active IS true)
   (0.1ms)  BEGIN
Creating scope :page. Overwriting existing method Service.page.
Creating scope :page. Overwriting existing method Category.page.
   (0.1ms)  ROLLBACK
Completed 500 Internal Server Error in 79ms

ActiveRecord::AssociationTypeMismatch (Service(#50963840) expected, got Service(#70493480)):

有人可以解释可能是什么问题吗?

4

1 回答 1

0

这是我的错误..我指的是实际上不是服务对象的服务关联:)

于 2012-08-07T12:53:24.080 回答