Skip to content

Commit e66d573

Browse files
committed
Fix model
1 parent a846692 commit e66d573

File tree

1 file changed

+4
-1
lines changed
  • lib/travis/api/v3/models

1 file changed

+4
-1
lines changed

lib/travis/api/v3/models/job.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Models::Job < Model
1515
belongs_to :stage
1616
belongs_to :owner, polymorphic: true
1717
belongs_to :config, foreign_key: :config_id, class_name: Models::JobConfig
18-
belongs_to :restarter, foreign_key: :restarted_by, polymorphic: true, class_name: Models::User
1918
serialize :config
2019
serialize :debug_options
2120

@@ -68,6 +67,10 @@ def migrated?
6867
!!org_id
6968
end
7069

70+
def restarter
71+
@restarter ||= Travis::API::V3::Models::User.find(restarted_by)
72+
end
73+
7174
private def enterprise?
7275
!!Travis.config.enterprise
7376
end

0 commit comments

Comments
 (0)