Sha256: 06ec58748991b39182dd2bcd756c4c4e6d91953f611ad3a44dc7b0c258d9e029

Contents?: true

Size: 682 Bytes

Versions: 44

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    class AnswerOption < Meetings::ApplicationRecord
      include Decidim::TranslatableResource

      default_scope { order(arel_table[:id].asc) }

      translatable_fields :body

      belongs_to :question, class_name: "Decidim::Meetings::Question", foreign_key: "decidim_question_id"
      has_many :choices,
               class_name: "AnswerChoice",
               foreign_key: "decidim_answer_option_id",
               dependent: :destroy,
               inverse_of: :answer_option

      def translated_body
        Decidim::Forms::AnswerOptionPresenter.new(self).translated_body
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
decidim-meetings-0.29.1 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.4 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.27.9 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.29.0 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.3 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.27.8 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.29.0.rc4 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.29.0.rc3 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.29.0.rc2 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.29.0.rc1 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.2 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.27.7 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.1 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.27.6 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.26.10 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.26.9 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.0 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.27.5 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.0.rc5 app/models/decidim/meetings/answer_option.rb
decidim-meetings-0.28.0.rc4 app/models/decidim/meetings/answer_option.rb