Implement offline POST method for starting an offline participation
Some checks failed
CI / scan_ruby (push) Successful in 17s
CI / scan_js (push) Successful in 14s
CI / lint (push) Failing after 15s
CI / test (push) Successful in 42s

This commit is contained in:
sto
2025-10-30 11:37:20 +01:00
parent aea001cdf6
commit 37a65526e4
12 changed files with 94 additions and 25 deletions

View File

@@ -4,6 +4,7 @@
#
# id :integer not null, primary key
# end_time :datetime
# name :string not null
# start_time :datetime not null
# created_at :datetime not null
# updated_at :datetime not null
@@ -23,5 +24,17 @@ class Offline < ApplicationRecord
has_one_attached :start_image
has_one_attached :end_image
validates :name, presence: true
validates :start_time, presence: true
validate :start_image_is_present
def start_image_is_present
logger = Logger.new(STDOUT)
logger.info "TESTddfzefzef"
logger.info self.start_image.attached?
if !self.start_image.attached?
errors.add(:start_image, I18n.t("activerecord.errors.models.offline.attributes.start_image.blank"))
end
end
end