Sha256: ec861d2227f366b647b4db0ebf61d82daaca1338b80c0656fd7b467b04986839

Contents?: true

Size: 707 Bytes

Versions: 11

Compression:

Stored size: 707 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Accountability
    # Exposes result versions so users can see how a result
    # has been updated through time.
    class VersionsController < Decidim::Accountability::ApplicationController
      helper Decidim::TraceabilityHelper
      helper Decidim::Accountability::BreadcrumbHelper
      helper_method :current_version, :result

      private

      def result
        @result ||= Result.includes(:timeline_entries).where(feature: current_feature).find(params[:result_id])
      end

      def current_version
        return nil if params[:id].to_i < 1
        @current_version ||= result.versions[params[:id].to_i - 1]
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
decidim-accountability-0.10.1 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.10.0 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.9.3 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.9.2 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.9.1 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.9.0 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.8.4 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.8.3 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.8.2 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.8.1 app/controllers/decidim/accountability/versions_controller.rb
decidim-accountability-0.8.0 app/controllers/decidim/accountability/versions_controller.rb