Sha256: 7a7ce6d309a61960c3aa850e0d99ec67f2099ee6b6d6e019b7537a829d91de97
Contents?: true
Size: 656 Bytes
Versions: 28
Compression:
Stored size: 656 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module ResourceVersionsConcern extend ActiveSupport::Concern included do helper Decidim::TraceabilityHelper helper_method :current_version, :versioned_resource private # Overwrite this method in your controller to define how to find the # versioned resource. def versioned_resource raise StandardError, "Not implemented" end def current_version return nil unless params[:id].to_i.positive? @current_version ||= versioned_resource.versions[params[:id].to_i - 1] end end end end
Version data entries
28 entries across 28 versions & 1 rubygems