Consolidating references to storage apps table - #44995
Conversation
ccfa4da to
5ecfeea
Compare
| :storage_apps__value___value, | ||
| :storage_apps__project_type___project_type, | ||
| :storage_apps__published_at___published_at, | ||
| storage_apps_fields = prefix_storage_app_fields(%w(id___id storage_id___storage_id value___value project_type___project_type published_at___published_at)) |
There was a problem hiding this comment.
Mostly curious, why was this change needed?
There was a problem hiding this comment.
I did this so that it'd be easier to swap out the table name prefix from storage_apps to projects
There was a problem hiding this comment.
I see. I find this a bit harder to read but hopefully this will all go away very soon so this looks good to me for now. Ship it!
| where(storage_id: user_storage_id). | ||
| map(:id) | ||
| user_storage_apps = StorageApps.new(user_storage_id) | ||
| channel_ids = user_storage_apps.get_all_storage_ids |
There was a problem hiding this comment.
Should we rename channel_ids to reduce confusion here?
There was a problem hiding this comment.
Yes! Another perfect example of where the use of the term "channel" is confusing. I'll swap this out now, but I have another ticket https://codedotorg.atlassian.net/browse/LP-2272 where I intend to do a more focused sweep of the names we're using
| StorageApps.table.where(id: ids) | ||
| end | ||
|
|
||
| def self.table |
There was a problem hiding this comment.
How much additional work is it to make this private? (I'm guessing projects_list is going to biggest pain here, ok to defer until later but I think we'll want to make this private at some point.)
There was a problem hiding this comment.
Ideally in the future we'll be using an ActiveRecord model for queries and we won't need to explicitly reference the table
The changes here remove direct references to the storage apps table in pegasus and replace them with references to methods in
storage_apps.rb. This is in preparation to move the table into dashboard DB and rename itprojects. Minimizing the number of places that we reference the table name makes this transition easier.(Swap out behind the flag started here: #45476)
Links
Testing story
Tested that project pages, creating a new project and project-backed levels still work as expected.
PR Checklist: