0
按軌道指導說:ActiveRecord::AssociationTypeMismatch
應提高時,纔會有關聯的不匹配,但在我的情況下,其新的東西..哪裏的軌道有「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)):
有人可以解釋什麼可能是可能的問題?
你可以發佈生成該日誌輸出的代碼嗎? – 2012-04-10 14:31:41
@DylanMarkow實際上'active_admin'正在被使用,但它應該做些像'@ room.update_attributes(params [:room])' – 2012-04-11 05:03:54