paperclip_database icon indicating copy to clipboard operation
paperclip_database copied to clipboard

No need for more then 1 db table

Open kubenstein opened this issue 11 years ago • 2 comments

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?

kubenstein avatar Dec 02 '13 20:12 kubenstein

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.

jarl-dk avatar Dec 02 '13 20:12 jarl-dk

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.

kubenstein avatar Dec 03 '13 22:12 kubenstein