abalone
abalone copied to clipboard
Refactor organization association
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 I am going to take a look at this one. I'll get some ideas together before we meet this afternoon
@web-kat Sounds good! Thank you!!
@CraigJZ would you mind assigning me to this one?