diff options
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 } |