Sha256: dc3bec32a2aacf6d5f063660bed2689ff7379bd9b1dd23b861e631c267993809
Contents?: true
Size: 659 Bytes
Versions: 7
Compression:
Stored size: 659 Bytes
Contents
# frozen_string_literal: true module Decidim module Proposals # Exposes CollaborativeDraft versions so users can see how a CollaborativeDraft # has been updated through time. class VersionsController < Decidim::Proposals::ApplicationController helper Decidim::TraceabilityHelper helper_method :current_version, :item private def item @item ||= CollaborativeDraft.where(component: current_component).find(params[:collaborative_draft_id]) end def current_version return nil if params[:id].to_i < 1 @current_version ||= item.versions[params[:id].to_i - 1] end end end end
Version data entries
7 entries across 7 versions & 1 rubygems