Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-08-21 17:34:21 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-08-21 17:51:38 +0300
commit6f8b9a16f508935ad23c42402440bb269e12e071 (patch)
tree6c9ee2c49a06a774aa00bedfce1100821f33b75e /app
parent237d26b9d6ca4c4d60010dc8b2db29cdfb8b4e42 (diff)
Merge branch 'sh-fix-atom-feeds' into 'master'
Fix 500 errors in Atom feeds due to push events Closes #36705 See merge request !13695
Diffstat (limited to 'app')
-rw-r--r--app/models/event.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index f2a560a6b56..15ee170ca75 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -83,6 +83,10 @@ class Event < ActiveRecord::Base
self.inheritance_column = 'action'
class << self
+ def model_name
+ ActiveModel::Name.new(self, nil, 'event')
+ end
+
def find_sti_class(action)
if action.to_i == PUSHED
PushEvent
@@ -438,6 +442,12 @@ class Event < ActiveRecord::Base
EventForMigration.create!(new_attributes)
end
+ def to_partial_path
+ # We are intentionally using `Event` rather than `self.class` so that
+ # subclasses also use the `Event` implementation.
+ Event._to_partial_path
+ end
+
private
def recent_update?