根据导轨指南说ActiveRecord::AssociationTypeMismatch
只有在关联不匹配时才会引发,但在我的情况下它应该是新的......
以下是例外:
ActiveRecord::AssociationTypeMismatch (Service(#50963840) expected, got Service(#70493480)):
参数trace:
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)):
有人可以解释可能存在的问题吗?
答案 0 :(得分:0)
这是我的错误..我指的是服务协会,它实际上不是服务对象:)