Skip to content

Commit

Permalink
refactor: load organization from db if possible (#1959)
Browse files Browse the repository at this point in the history
taken from #1949

This can be merged independently, so let's do that!

Co-authored-by: Samuel Oey <samuel.oey@gmail.com>
  • Loading branch information
roschaefer and soey authored Aug 6, 2024
1 parent 2605b55 commit 826f8ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ def delete_otp_session_variables

private

# TODO: Refactor this in Phase II to handle multi-tenancy
def set_organization
@organization = Organization.singleton
@organization = if params[:organization_id].present?
Organization.find(params[:organization_id])
else
Organization.singleton
end
end
end

0 comments on commit 826f8ea

Please sign in to comment.