diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-04 17:00:39 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-11-04 17:00:39 +0300 |
commit | b0a4635be395f0ce14e15e1671d7acfc2360d1ba (patch) | |
tree | f3baf07305d9c296e785979f70feb64e75c461dc /app/serializers/request_aware_entity.rb | |
parent | e49fb264e6cb5eff44330d69d34b5f74ef262659 (diff) |
Simplify implementation of entity serializers
Diffstat (limited to 'app/serializers/request_aware_entity.rb')
-rw-r--r-- | app/serializers/request_aware_entity.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/serializers/request_aware_entity.rb b/app/serializers/request_aware_entity.rb index 1586507492d..ff8c1142abc 100644 --- a/app/serializers/request_aware_entity.rb +++ b/app/serializers/request_aware_entity.rb @@ -1,10 +1,11 @@ module RequestAwareEntity - attr_reader :request + extend ActiveSupport::Concern - def initialize(object, options = {}) - super(object, options) + included do + include Gitlab::Routing.url_helpers + end - @request = options.fetch(:request) - @urls = Gitlab::Routing.url_helpers + def request + @options.fetch(:request) end end |