You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, spork -d shows only config files so models are not preloaded.
I'm also using Spork with Test:Unit (actually Minitest, last version from Rubygems), Rails 3 (with Spork last rc) and Ruby 1.9.2.
I had to put a load instruction for all my models in Spork#each_run because not all files under /app/models where loaded (I have subdirectories).
But the behavior I get is when my models is invalid, errors are duplicates:
foo = Foo.new(:bar => '').valid? #=> false
foo.errors #=> {:bar => ["can't be blank", "can't be blank"]}
For now if I reload only models from /models subdirectories I get the expected behavior. But this is kind of ugly.
The text was updated successfully, but these errors were encountered:
Had the same issue here. Tryed every jujitso/workaround/patch myself thing to make spork 0.8.5 work w/o luck.
That one ([Rails.root, 'models/*.].each(&load.....) I call the load'em all, and its a bad idea! You'll get that double errors and plus some other glitches with "cache_classes = true" in test enviroment (fabrication and machinist don't behave nicely that way).
Try spork 0.9.0.rc9, it's all working perfect here, models reloading and no bugs, I dunno why (yet, just found out heh). Just did the trap load_models of mongoid.
Just to confirm: that's finally reloading my models and no glitches in rails 3.1.1, with cache_classes = true.
(besides bugs, cache_classes = false makes my 30s suite take 2:00 to run! major pita.
First, spork -d shows only config files so models are not preloaded.
I'm also using Spork with Test:Unit (actually Minitest, last version from Rubygems), Rails 3 (with Spork last rc) and Ruby 1.9.2.
I had to put a load instruction for all my models in Spork#each_run because not all files under /app/models where loaded (I have subdirectories).
But the behavior I get is when my models is invalid, errors are duplicates:
For now if I reload only models from /models subdirectories I get the expected behavior. But this is kind of ugly.
The text was updated successfully, but these errors were encountered: