13db384648
Patch load_schmema! to set the default value for UUID primary keys. This removes the need to patch ApplicationRecord + Rails models individually. It also means we no longer need to patch the default in for the integer primary key in Search::Record::SQLite.
11 lines
415 B
Ruby
11 lines
415 B
Ruby
# Inject account associations into Rails framework models
|
|
Rails.application.config.to_prepare do
|
|
ActionText::RichText.belongs_to :account, default: -> { record.account }
|
|
|
|
ActiveStorage::Attachment.belongs_to :account, default: -> { record.account }
|
|
|
|
ActiveStorage::Blob.belongs_to :account, default: -> { Current.account }
|
|
|
|
ActiveStorage::VariantRecord.belongs_to :account, default: -> { blob.account }
|
|
end
|