Sha256: a0982b17051a433093401fef34b85b88337aa262c5f2e0647ec964594c26198d

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Decidim
  module Accountability
    # The data store for a Status in the Decidim::Accountability component. It stores a
    # key, a localized name, a localized description and and associated progress number.
    class Status < Accountability::ApplicationRecord
      include Decidim::HasComponent
      include Decidim::TranslatableResource
      include Decidim::FilterableResource
      include Decidim::Traceable

      component_manifest_name "accountability"

      translatable_fields :name, :description

      has_many :results, foreign_key: "decidim_accountability_status_id", class_name: "Decidim::Accountability::Result", inverse_of: :status, dependent: :nullify

      validates :key, presence: true, uniqueness: { scope: :decidim_component_id }
      validates :name, presence: true

      # Allow ransacker to search for a key in a hstore column (`name`.`en`)
      ransacker_i18n :name

      def self.log_presenter_class_for(_log)
        Decidim::Accountability::AdminLog::StatusPresenter
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
decidim-accountability-0.28.4 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.9 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.3 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.8 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.2 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.7 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.1 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.6 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.0 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.5 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.0.rc5 app/models/decidim/accountability/status.rb
decidim-accountability-0.28.0.rc4 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.4 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.3 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.2 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.1 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.0 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.0.rc2 app/models/decidim/accountability/status.rb
decidim-accountability-0.27.0.rc1 app/models/decidim/accountability/status.rb