def belongs_to_multitenant(association = :tenant)
      reflection = reflect_on_association association
      before_validation Proc.new {|m|
        m.send("#{association}=".to_sym, Multitenant.current_tenant) if Multitenant.current_tenant
      }, :on => :create
      default_scope lambda {
        where({reflection.foreign_key => Multitenant.current_tenant.id}) if Multitenant.current_tenant
      }
    end
def belongs_to_multitenant(association = :tenant)
      reflection = reflect_on_association association
      before_validation Proc.new {|m|
        m.send("#{association}=".to_sym, Multitenant.current_tenant) if Multitenant.current_tenant
      }, :on => :create
      default_scope lambda {
        where({reflection.foreign_key => Multitenant.current_tenant.id}) if Multitenant.current_tenant
      }
    end
configure the current model to automatically query and populate objects based on the current tenant
 see Multitenant#current_tenant