mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 15:54:00 +08:00
Merge pull request #4573 from artoscinote/ma_SCI_7377
Add ENV setting for max step text length [SCI-7377]
This commit is contained in:
commit
938f2ce63b
1 changed files with 5 additions and 1 deletions
|
@ -5,7 +5,11 @@ class StepText < ApplicationRecord
|
|||
include ActionView::Helpers::TextHelper
|
||||
|
||||
auto_strip_attributes :text, nullify: false
|
||||
validates :text, length: { maximum: Constants::RICH_TEXT_MAX_LENGTH }
|
||||
validates :text, length:
|
||||
{
|
||||
maximum:
|
||||
ENV['STEP_TEXT_MAX_LENGTH'].present? ? ENV['STEP_TEXT_MAX_LENGTH'].to_i : Constants::RICH_TEXT_MAX_LENGTH
|
||||
}
|
||||
|
||||
belongs_to :step, inverse_of: :step_texts, touch: true
|
||||
has_one :step_orderable_element, as: :orderable, dependent: :destroy
|
||||
|
|
Loading…
Reference in a new issue