Sha256: 01a6bae349da26bce232422a031eb14232b70d2e2c9785f5da8d34836986b6d9
Contents?: true
Size: 750 Bytes
Versions: 1
Compression:
Stored size: 750 Bytes
Contents
# frozen_string_literal: true module Account class ViolationForm < ApplicationForm attribute :order_id, Integer attribute :content, String attribute :is_revise, Boolean attribute :deadline, DateTime validates :order_id, presence: true validates :content, presence: true, length: { maximum: 1000 } def submit return false unless valid? _is_revise = is_revise api_answer = TranslationCms::Api::Customers::Violation.create(submit_params(attributes)) merge_responce! api_answer self.is_revise = _is_revise errors.empty? end protected def submit_params(params) params[:deadline] = Time.current + 24.hours if params[:deadline].blank? params end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
translation_cms-0.1.5 | app/forms/account/violation_form.rb |