Sha256: 6987661d3299fc6884f3bd4bbc8b96584719faf476e12982275a3909f18a7fb3

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module EnhancedTextwork
    # A valuation assignment links a paragraph and a Valuator user role.
    # Valuators will be users in charge of defining the monetary cost of a
    # paragraph.
    class ValuationAssignment < ApplicationRecord
      include Decidim::Traceable
      include Decidim::Loggable

      belongs_to :paragraph, foreign_key: "decidim_paragraph_id", class_name: "Decidim::EnhancedTextwork::Paragraph"
      belongs_to :valuator_role, polymorphic: true

      def self.log_presenter_class_for(_log)
        Decidim::EnhancedTextwork::AdminLog::ValuationAssignmentPresenter
      end

      def valuator
        valuator_role.user
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-enhanced_textwork-1.0.5 app/models/decidim/enhanced_textwork/valuation_assignment.rb
decidim-enhanced_textwork-1.0.4 app/models/decidim/enhanced_textwork/valuation_assignment.rb
decidim-enhanced_textwork-1.0.3 app/models/decidim/enhanced_textwork/valuation_assignment.rb
decidim-enhanced_textwork-1.0.2 app/models/decidim/enhanced_textwork/valuation_assignment.rb
decidim-enhanced_textwork-1.0.1 app/models/decidim/enhanced_textwork/valuation_assignment.rb
decidim-enhanced_textwork-1.0.0 app/models/decidim/enhanced_textwork/valuation_assignment.rb