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 ...@@ -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 1. Create `ee/app/replicators/geo/widget_replicator.rb`. Implement the
`#carrierwave_uploader` method which should return a `CarrierWave::Uploader`. `#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 ```ruby
# frozen_string_literal: true # frozen_string_literal: true
...@@ -197,14 +197,12 @@ For example, to add support for files referenced by a `Widget` model with a ...@@ -197,14 +197,12 @@ For example, to add support for files referenced by a `Widget` model with a
class WidgetReplicator < Gitlab::Geo::Replicator class WidgetReplicator < Gitlab::Geo::Replicator
include ::Geo::BlobReplicatorStrategy include ::Geo::BlobReplicatorStrategy
def carrierwave_uploader def self.model
model_record.file ::Widget
end end
private def carrierwave_uploader
model_record.file
def model
::Widget
end end
end end
end end
......
...@@ -4,12 +4,12 @@ module Geo ...@@ -4,12 +4,12 @@ module Geo
class PackageFileReplicator < Gitlab::Geo::Replicator class PackageFileReplicator < Gitlab::Geo::Replicator
include ::Geo::BlobReplicatorStrategy include ::Geo::BlobReplicatorStrategy
def carrierwave_uploader
model_record.file
end
def self.model def self.model
::Packages::PackageFile ::Packages::PackageFile
end end
def carrierwave_uploader
model_record.file
end
end 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