Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor organization association #713

Open
CraigJZ opened this issue Jun 29, 2021 · 3 comments
Open

Refactor organization association #713

CraigJZ opened this issue Jun 29, 2021 · 3 comments

Comments

@CraigJZ
Copy link
Collaborator

CraigJZ commented Jun 29, 2021

Currently, individual models are scoped to an organization.

Organization

has_many :users
has_many :cohorts
has_many :enclosures
has_many :measurements
has_many :measurement_events
has_many :operations
has_many :facilities
has_many :animals

An alternative would be to key organization off of a single source, likely facilities.

has_many :users
has_many :facilities

Organizations would likely be determined by the current user's organization.

Some additional considerations are:

  • The Blazer rake task looks for an organziation_id on a model when determining how to set the row level security. We would need to consider this.
  • This may complicate the SQL Queries a bit
@web-kat
Copy link
Contributor

web-kat commented Oct 14, 2021

@CraigJZ I am going to take a look at this one. I'll get some ideas together before we meet this afternoon

@CraigJZ
Copy link
Collaborator Author

CraigJZ commented Oct 14, 2021

@web-kat Sounds good! Thank you!!

@web-kat
Copy link
Contributor

web-kat commented Oct 15, 2021

@CraigJZ would you mind assigning me to this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants