diff options
Diffstat (limited to 'app/models/push_event.rb')
-rw-r--r-- | app/models/push_event.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/push_event.rb b/app/models/push_event.rb index 4698df39730..5cab686f20b 100644 --- a/app/models/push_event.rb +++ b/app/models/push_event.rb @@ -26,6 +26,8 @@ class PushEvent < Event delegate :commit_count, to: :push_event_payload alias_method :commits_count, :commit_count + delegate :ref_count, to: :push_event_payload + # Returns events of pushes that either pushed to an existing ref or created a # new one. def self.created_or_pushed @@ -52,7 +54,7 @@ class PushEvent < Event .select(1) .where('merge_requests.source_project_id = events.project_id') .where('merge_requests.source_branch = push_event_payloads.ref') - .where(state: :opened) + .with_state(:opened) # For reasons unknown the use of #eager_load will result in the # "push_event_payload" association not being set. Because of this we're |