diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-04-29 17:23:59 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-04-29 17:23:59 +1100 |
commit | 68c75bc0f9f279602c5269569fb892b4ed243403 (patch) | |
tree | 6f41fddc8daf163cca35e06fd68e971eed247895 /app/models/commit.rb | |
parent | ee189fd511e1a2c06f05e0d40e1d0b8875151391 (diff) | |
download | gitlab-ce-68c75bc0f9f279602c5269569fb892b4ed243403.tar.gz |
[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 #<Gitlab::Git::Commit:0x00005573f5196270>
# ./app/models/commit.rb:259:in `method_missing'
# ./spec/requests/api/todos_spec.rb:12:in `block (2 levels) in <top (required)>'
```
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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? |