Sha256: 6819f0515afb5ff6e86c84dda471f0183e21883a43aaf150f8badad9cf643b5c

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

# frozen_string_literal: true

module Decidim
  autoload :ActionAuthorizationHelper, "decidim/action_authorization_helper"
  autoload :ResourceHelper, "decidim/resource_helper"

  class ViewModel < Cell::ViewModel
    include ActionView::Helpers::TranslationHelper
    include ::Cell::Translation
    include Decidim::ResourceHelper
    include Decidim::ScopesHelper
    include ActionController::Helpers
    include Decidim::ActionAuthorization
    include Decidim::ActionAuthorizationHelper
    include Decidim::ReplaceButtonsHelper
    include Decidim::MarkupHelper

    delegate :current_organization, to: :controller

    def current_user
      context&.dig(:current_user) || controller&.current_user
    end

    private

    def decidim
      Decidim::Core::Engine.routes.url_helpers
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-core-0.22.0 lib/decidim/view_model.rb