summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-05-14 16:59:39 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-05-26 15:48:32 -0400
commitb88da58cb6272a86b6df2e4efe392f10e689a6b2 (patch)
tree1271524cfe6fa5d733cc847c72b96a19810d06aa /app/models/concerns
parent94af050117df20a661e03055a5002cae90282d6d (diff)
downloadgitlab-ce-b88da58cb6272a86b6df2e4efe392f10e689a6b2.tar.gz
Add `reference_pattern` to Referable models
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/referable.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/concerns/referable.rb b/app/models/concerns/referable.rb
index b41df301c3f..e3c1c6d268e 100644
--- a/app/models/concerns/referable.rb
+++ b/app/models/concerns/referable.rb
@@ -35,6 +35,16 @@ module Referable
def reference_prefix
''
end
+
+ # Regexp pattern used to match references to this object
+ #
+ # This must be overridden by the including class.
+ #
+ # Returns Regexp
+ def reference_pattern
+ raise NotImplementedError,
+ %Q{#{self} does not implement "reference_pattern"}
+ end
end
private