Sha256: c35b4f9e110a8315dd91cda865d9540492494c360818fa4ceadf590b2be42a14

Contents?: true

Size: 701 Bytes

Versions: 12

Compression:

Stored size: 701 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class ReminderRecord < ApplicationRecord
    belongs_to :reminder, foreign_key: "decidim_reminder_id", class_name: "Decidim::Reminder"
    belongs_to :remindable, foreign_type: "remindable_type", polymorphic: true, optional: true

    scope :active, -> { where(state: "active") }
    scope :pending, -> { where(state: "pending") }
    scope :completed, -> { where(state: "completed") }
    scope :deleted, -> { where(state: "deleted") }

    def active?
      state == "active"
    end

    def pending?
      state == "pending"
    end

    def completed?
      state == "completed"
    end

    def deleted?
      state == "deleted"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/models/decidim/reminder_record.rb
decidim-core-0.27.8 app/models/decidim/reminder_record.rb
decidim-core-0.27.7 app/models/decidim/reminder_record.rb
decidim-core-0.27.6 app/models/decidim/reminder_record.rb
decidim-core-0.27.5 app/models/decidim/reminder_record.rb
decidim-core-0.27.4 app/models/decidim/reminder_record.rb
decidim-core-0.27.3 app/models/decidim/reminder_record.rb
decidim-core-0.27.2 app/models/decidim/reminder_record.rb
decidim-core-0.27.1 app/models/decidim/reminder_record.rb
decidim-core-0.27.0 app/models/decidim/reminder_record.rb
decidim-core-0.27.0.rc2 app/models/decidim/reminder_record.rb
decidim-core-0.27.0.rc1 app/models/decidim/reminder_record.rb