This project is archived and is in readonly mode.
raise_on_type_mismatch : expected User, got User
-
Roger
add me as a user wishing this patch were applied.
-
Lawrence Pit
@Pratik : I suggest you look closer at my patch. It actually takes care of NOT showing the error message, something that ticket #189 ActiveRecord::AssociationTypeMismatch with same class name -- added helpful e... does not do.
-
Pratik
Yes I noticed.
1. The tests pass even without the patch. Also, the patch is in wrong directory. Should be in ar/test/cases/
2. Not really in favor of putting eval stuff. I.e. magically reloading plugin model.
3.People should just make plugins reloadable instead.
Thanks.
-
Roger
I wonder if it couldn't use something like
if is_a?(klass) or is_a?(eval(klass)) # only use the eval as a backup...
-R
-
Lawrence Pit
@Roger that is what it's doing, it's only used as a backup
@Pratik the test was in the wrong dir, I've attached two new files: one with the test, one with the patch. If you run the test it does NOT pass without the patch.
-
vamsee
- Assigned user set to Pratik
- Tag set to activerecord, patch, tests
Please add Lawrence's patch to core. This problem still comes up, and the above patch solves it. Ticket no. #189 ActiveRecord::AssociationTypeMismatch with same class name -- added helpful e... only displays the error properly, but does not fix it.
-
Luke Sheridan
Thank you for this patch Lawrence, the error was driving me nuts!
-
Pratik
- State changed from invalid to open
-
Repository
- State changed from open to resolved
(from [7659fb6a2b638703a99a63033d947d19089a6b85]) Try reloading model on class mismatch [#229 raise_on_type_mismatch : expected User, got User state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
-
Anil Wadghule
Automatic cleanup of spam.
-
Anil Wadghule
Automatic cleanup of spam.
-
Anil Wadghule
Automatic cleanup of spam.
-
Anil Wadghule
Automatic cleanup of spam.
-
Aditya Sanghi
Automatic cleanup of spam.
-
Ryan Bigg
Automatic cleanup of spam.
