I have an application developed in Rails 1.2.something (I'm porting it to rails 4 and that is a story in itself, please ignore this for the moment).
The application (a Property Management System) has been used until now by a single property accessing it through basic http authentication.
Now I want to sell the system to many properties hence the need to use the userid as a foreign key in EVERY table of the application. I'll provide a (simplified) example here:
When I'll write for example "Property.find(:all)" I want the application to find all properties with a certain "userid" (taken from http authentication) set up. When I'll write "Property.save" I want the application to automatically fill in the "userid" field with the userid taken from http authentication again, and so on...
The question is: what is the best way to modify an existing application so that EVERY activerecord interaction in the application takes the new field "userid" into account?
I other words: I have an application created for a single user, many years ago (2006). What would be the best way to change this application in order to be able to store in the database data for multiple users?