mumuki / mumuki-laboratory

:microscope: Where students practice and receive automated and human feedback
http://mumuki.io
GNU Affero General Public License v3.0
203 stars 26 forks source link

Be able to define non-tenantized routes #1565

Open luchotc opened 3 years ago

luchotc commented 3 years ago

It would be nice to be able to have routes like /faqs or /terms, which would redirect the user based on its student_granted_organizations. A criteria should be established to obtain the "best" organization for the user to be redirected to, and only in a tie situation, prompt a pop-up for the user to choose it.

We could use a logic similar to the one behind smart redirections (take into account that that feature is designed based on a clear origin organization). Something like

user.rb

def single_immersive_organization
  student_granted_organizations.flat_map { |it| immersive_organizations_for(it) }.uniq.single 
end

We could make this method part of main_organization logic as well

luchotc commented 3 years ago

Related to #1564