@@ -60,21 +60,23 @@ TODO:
6060
6161- Active Record class methods
6262 - [ ] ` .tenanted `
63- - extends with ` Base `
64- - sets ` Tenant.base_class= `
65- - must only be set ONCE in the application
63+ - [x] mixin ` Tenant `
64+ - [x] should error if self is not an abstract base class
65+ - [x] ` tenant_config_name ` and ` .tenanted? `
6666 - [ ] ` .tenanted_with `
67- - extends with ` Sublet `
68- - should error if self is not an abstract base class or if target is not tenanted abstract base class
69- - is the name right? should we have to provide the name of the tenanted class?
70- - [ ] ` .tenanted? `
67+ - [ ] mixin ` Subtenant `
68+ - [ ] should error if self is not an abstract base class or if target is not tenanted abstract base class
7169 - [ ] ` .tenanted_class ` nil or the abstract base class
7270 - [ ] all the creation and schema migration complications (we have existing tests for this)
7371 - think about race conditions here, maybe use a file lock to figure it out
7472 - running migrations (they are done in a transaction, but the second thread's migration may fail resulting in a 500?)
7573 - loading schemas (if the first thread loads the schema and inserts data, can the second thread accidentally drop/load causing data loss?)
7674 - [ ] feature to turn off automatic creation/migration
7775 - make sure we pay attention to Rails.config.active_record.migration_error when we turn off auto-migrating
76+ - thinking
77+ - should there be a global singleton ` Tenant ` ? I'm not sure we need it or the limitations of a global.
78+ - if we do, though, then ` .tenanted ` should set ` Tenant.base_class= `
79+ - and we need to add checks that ` .tenanted ` is called only ONCE in the application
7880
7981- database tasks
8082 - [ ] RootConfig should conditionally re-enable database tasks ... when AR_TENANT is present?
0 commit comments