abalone icon indicating copy to clipboard operation
abalone copied to clipboard

Refactor organization association

Open CraigJZ opened this issue 4 years ago • 3 comments

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

CraigJZ avatar Jun 29 '21 22:06 CraigJZ

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

web-kat avatar Oct 14 '21 14:10 web-kat

@web-kat Sounds good! Thank you!!

CraigJZ avatar Oct 14 '21 15:10 CraigJZ

@CraigJZ would you mind assigning me to this one?

web-kat avatar Oct 15 '21 17:10 web-kat