Commit c19467f2 authored by Marcia Ramos's avatar Marcia Ramos

Merge branch 'tc-ssf-model-class-method' into 'master'

Geo: `model` on replicator should be class method

See merge request gitlab-org/gitlab!35763
parents 4ad5f074 813b58bb
......@@ -188,7 +188,7 @@ For example, to add support for files referenced by a `Widget` model with a
1. Create `ee/app/replicators/geo/widget_replicator.rb`. Implement the
`#carrierwave_uploader` method which should return a `CarrierWave::Uploader`.
And implement the private `#model` method to return the `Widget` class.
And implement the class method `.model` to return the `Widget` class.
```ruby
# frozen_string_literal: true
......@@ -197,14 +197,12 @@ For example, to add support for files referenced by a `Widget` model with a
class WidgetReplicator < Gitlab::Geo::Replicator
include ::Geo::BlobReplicatorStrategy
def carrierwave_uploader
model_record.file
def self.model
::Widget
end
private
def model
::Widget
def carrierwave_uploader
model_record.file
end
end
end
......
......@@ -4,12 +4,12 @@ module Geo
class PackageFileReplicator < Gitlab::Geo::Replicator
include ::Geo::BlobReplicatorStrategy
def carrierwave_uploader
model_record.file
end
def self.model
::Packages::PackageFile
end
def carrierwave_uploader
model_record.file
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment