Sha256: 1d08db0bfff6adee8ca3d7ecc221a6169fbc876cda546b1f0c7684108c561540

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Calendar
    class ExternalEvent < Calendar::ApplicationRecord
      include Decidim::Authorable

      belongs_to :organization,
                 foreign_key: "decidim_organization_id",
                 class_name: "Decidim::Organization"

      validates :title, :start_at, :end_at, presence: true
      validates :start_at, date: { before: :end_at, allow_blank: false, if: proc { |obj| obj.end_at.present? } }
      validates :end_at, date: { after: :start_at, allow_blank: true, if: proc { |obj| obj.start_at.present? } }

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
decidim-calendar-0.13.1.3 app/models/decidim/calendar/external_event.rb