According to this answer they are, but then the poster states that things work differently in JRuby so I am confused?
I am implementing a multi tenancy solution using class instance variables, so it doesn't matter what Ruby implementation or web server I am using, I need to make sure that data cannot be leaked.
Here is my code:
class Tenant < ActiveRecord::Base
def self.current_tenant=(tenant)
@tenant = tenant
end
def self.current_tenant
@tenant
end
end
What do I need to do to make sure that no matter what happens (changing Ruby implementation, changing web server, new Ruby threading capabilities etc) that my code is thread safe?