Module: Ckeditor::Backend::ActiveStorage::ClassMethods

Defined in:
lib/ckeditor/backend/active_storage.rb

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/ckeditor/backend/active_storage.rb', line 13

def self.extended(base)
  base.class_eval do
    before_save :apply_data
    validate do
      if data.nil? || file.nil?
        errors.add(:data, :not_data_present, message: "data must be present")
      end
    end
  end
end