From 68c75bc0f9f279602c5269569fb892b4ed243403 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Sun, 29 Apr 2018 17:23:59 +1100 Subject: [Rails5] Add `touch_later` to `Commit` model This commit fixes errors like: ``` 1) API::Todos GET /todos when unauthenticated returns authentication error Failure/Error: @raw.__send__(method, *args, &block) # rubocop:disable GitlabSecurity/PublicSend NoMethodError: undefined method `touch_later' for # # ./app/models/commit.rb:259:in `method_missing' # ./spec/requests/api/todos_spec.rb:12:in `block (2 levels) in ' ``` --- app/models/commit.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index 9750e9298ec..70e5accfd1f 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -420,6 +420,12 @@ class Commit # no-op but needs to be defined since #persisted? is defined end + def touch_later + # No-op. + # This method is called by ActiveRecord. + # We don't want to do anything for `Commit` model, so this is empty. + end + WIP_REGEX = /\A\s*(((?i)(\[WIP\]|WIP:|WIP)\s|WIP$))|(fixup!|squash!)\s/.freeze def work_in_progress? -- cgit v1.2.1