Commit 68c75bc0 authored by blackst0ne's avatar blackst0ne

[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)>'
```
parent ee189fd5
......@@ -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?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment