Task with a legacy schema nightmare.

I have a the great task of migrating the backend of a large multi client application to Rails!

I'm pumped for the opportunity to drop PHP, but a LOT of table schemas have a very "non-rails" setup. The main hangup is any image urls for the site live in a large monolithic table with a column to designate the other tables name and it's primary key that has an image.

Unfortunately I can't change the schema. How can I map paperclip or carrierwave to write the relative paths to rows like "small", "med", "lrg", "original" in this images table?

TImbeTImbe wrote in post #973079:

I have a the great task of migrating the backend of a large multi client application to Rails!

I'm pumped for the opportunity to drop PHP, but a LOT of table schemas have a very "non-rails" setup. The main hangup is any image urls for the site live in a large monolithic table with a column to designate the other tables name and it's primary key that has an image.

Unfortunately I can't change the schema.

Then either decline the project or create a REST service that your Rails app can read with ActiveResource. (I'd probably decline the project -- unchangeable schemes and multi-client DBs without an abstraction layer are recipes for disaster.)

How can I map paperclip or carrierwave to write the relative paths to rows like "small", "med", "lrg", "original" in this images table?

Best,