开发者

Organizing a lot of models that use STI in rails

开发者 https://www.devze.com 2022-12-30 21:13 出处:网络
I have a scenario where I am going to be creating a large number of models that use STI and I\'m wondering what the best way to organize this is.I already have othe开发者_C百科r models using STI and I

I have a scenario where I am going to be creating a large number of models that use STI and I'm wondering what the best way to organize this is. I already have othe开发者_C百科r models using STI and I really do not want to add any more files to my models folder. Is there any way to create a folder and add the models using STI there (there could be upwards of 40 b/c each uses its own methods to scrape a different site, but they all save the same data)? This seems like it would be best, or I could add them all to one file but I would rather separate them.


Adding a new directory is fine. Make sure you add it to the load paths in environment.rb, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消