Sha256: 80e481175eadf11a0fbff55356d930b6d87affe2cf8e985f07aa9b9c6a48a096
Contents?: true
Size: 647 Bytes
Versions: 29
Compression:
Stored size: 647 Bytes
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module Budgets # Shared behaviour for controllers that need the current order to be present. module NeedsCurrentOrder extend ActiveSupport::Concern included do helper_method :current_order # The current order created by the user. # # Returns an Order. def current_order @current_order ||= Order.includes(:projects).find_by(user: current_user, component: current_component) end def current_order=(order) @current_order = order end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems