From 6c1b3ecfb01a7e5f043110e9d46508a7c89c8a2c Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Mon, 8 Apr 2019 12:46:33 +0200 Subject: WIP --- app/presenters/blobs/unfold_presenter.rb | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'app/presenters/blobs/unfold_presenter.rb') 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 } -- cgit v1.2.1