We have a mid-sized application deployed for several clients on their respective VPS online servers. The code is the same for all customers. Maintenance is becoming a huge burden. Even the same change, we deploy on many servers. Thus, we plan to introduce a multiple rental function for our application.
We encountered several gems, but this does not mean that we use this goal, and therefore we plan to realize it.
We created a new Client model, and we created an abstract superclass that inherits from ActiveRecord::Base , and all dependent classes inherit this class. Now the problem arises when I want to add default_scope from my superclass.
class SuperClass < ActiveRecord::Base self.abstract_class = true default_scope where(:client_id => ???) end
??? changes for each user. Therefore, I cannot give a static value. But I'm not sure how I can dynamically set this area. So what can be done?
Rahul source share