diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-04-08 12:46:33 +0200 |
---|---|---|
committer | Peter Leitzen <pleitzen@gitlab.com> | 2019-04-08 12:46:33 +0200 |
commit | 6c1b3ecfb01a7e5f043110e9d46508a7c89c8a2c (patch) | |
tree | bfcd62adaa470acf3d469ca391a86a6db1a47a1b /app/presenters/blobs/unfold_presenter.rb | |
parent | 56ac52f6069be5bf4ea152047aafe34a99b1e854 (diff) | |
download | gitlab-ce-pl-remove-virtus.tar.gz |
Diffstat (limited to 'app/presenters/blobs/unfold_presenter.rb')
-rw-r--r-- | app/presenters/blobs/unfold_presenter.rb | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/app/presenters/blobs/unfold_presenter.rb b/app/presenters/blobs/unfold_presenter.rb index 7b13db3bb74..45af4a33c18 100644 --- a/app/presenters/blobs/unfold_presenter.rb +++ b/app/presenters/blobs/unfold_presenter.rb @@ -1,24 +1,15 @@ # frozen_string_literal: true -require 'gt_one_coercion' - module Blobs class UnfoldPresenter < BlobPresenter - include Virtus.model + include ActiveModel::Model include Gitlab::Utils::StrongMemoize - attribute :full, Boolean, default: false - attribute :since, GtOneCoercion - attribute :to, GtOneCoercion - attribute :bottom, Boolean - attribute :unfold, Boolean, default: true - attribute :offset, Integer - attribute :indent, Integer, default: 0 + attr_accessor :full, :since, :to, :bottom, :unfold, :offset, :indent def initialize(blob, params) - @subject = blob + super(blob, params) @all_lines = highlight.lines - super(params) if full? self.attributes = { since: 1, to: @all_lines.size, bottom: false, unfold: false, offset: 0, indent: 0 } |