diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-14 00:28:58 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-15 13:49:16 -0300 |
commit | 16c9abf1ee95551d130e8b8eb454c440ca4c2eb2 (patch) | |
tree | e13feef57f158966cd816a2e48ee3356dd6079cd /app/models/concerns/mentionable.rb | |
parent | 66c4ed6165d5e895ee802d9745205a05dfca9986 (diff) | |
download | gitlab-ce-16c9abf1ee95551d130e8b8eb454c440ca4c2eb2.tar.gz |
Use cattr_accessor instead duplicating code on NoteOnDiff concern
Diffstat (limited to 'app/models/concerns/mentionable.rb')
-rw-r--r-- | app/models/concerns/mentionable.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/concerns/mentionable.rb b/app/models/concerns/mentionable.rb index 8cac47246db..ec9e0f1b1d0 100644 --- a/app/models/concerns/mentionable.rb +++ b/app/models/concerns/mentionable.rb @@ -14,14 +14,14 @@ module Mentionable attr = attr.to_s mentionable_attrs << [attr, options] end + end + included do # Accessor for attributes marked mentionable. - def mentionable_attrs - @mentionable_attrs ||= [] + cattr_accessor :mentionable_attrs, instance_accessor: false do + [] end - end - included do if self < Participable participant -> (user, ext) { all_references(user, extractor: ext) } end |