Commit 813b58bb authored by Toon Claes's avatar Toon Claes

Method `model` on replicator should be on class

The method `model` on the replicator should be a class method. And
generally the class methods are defined before the instance methods.
parent 879d1679
......@@ -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