4 ms·
I probably need to do some code examples to illustrate the pain points I was experiencing for 1). When I migrated back to ActiveRecord I kept the same model ini
by ollysb 15y ago
I probably need to do some code examples to illustrate the pain points I was experiencing for 1). When I migrated back to ActiveRecord I kept the same model initially and found that I was able to significantly simplify the tests. My main difficulty was with methods that called save on embedded models. I suppose I could have stubbed those calls out but I generally prefer to test the integration with the db. Yeah, I know it's not a pure unit test but I find this is generally the more pragmatic approach.
I should say I think mongodb/mongoid can be very useful. My opinion so far though is that it's most effective as a performance optimisation strategy for a stable application.