3 ms·
Why are the dynamic finders being deprecated? Is it a speed/parsing thing? Or changing styles?
by mgkimsal 14y ago
Why are the dynamic finders being deprecated? Is it a speed/parsing thing? Or changing styles?
- danso 14y agoI had that question too...I was thinking that it must have some effect on performance but I thought it would be pretty minuscule?
- mgkimsal 14y agoOT performance rumination: I've not run tests on Rails' performance in this capacity, but I've always thought that the runtime gymnastics to pluralize model names would be a big drag on Rails performance. I'm guessing something's cached, but I've never understood the 'opinion' that a class should be 'Person' and the table name should be 'people'.
- lobster_johnson 14y agoChanging styles is my guess; less a reliance on auto-generated magic. There is nothing wrong with this: find_all_by_user_id_and_conversation_id(params[:user_id], @conversation.id) But this is equally (actually more) concise: where(user_id: params[:user_id], conversation_id: @conversation.id) ...and it builds on the composable scope system (derived from ARel).