paperclip_database
paperclip_database copied to clipboard
No need for more then 1 db table
I am wondering if we really need new table for each file in class? We can use only one table paperclip_database_files
which will be in polymorphic association with active record model. cleaner solution imho, what do you think?
I don't see minimizing number of database tables as a goal by itself... But if it could simplify design and reduce code my ears are open. But I think I need a more detailed/specific proposal.
On my fork I changed the code to store all attachments in one table, in my opinion the idea is much more simple now. Please take a look and share your opinion.
https://github.com/kubenstein/paperclip_database/compare/one_polymorphic_table
Integration tests are green. Had trouble to understand unit tests so for now they are still failing.