1234567891011121314151617181920212223242526 |
- module ApplicationModel::ChecksImport
- extend ActiveSupport::Concern
- included do
- before_create :check_attributes_protected
- end
- class_methods do
-
- def importable?
- false
- end
- end
- def check_attributes_protected
-
- return if !Setting.get('system_init_done')
- return if Setting.get('import_mode') && self.class.importable?
- return if !has_attribute?(:id)
- self[:id] = nil
- true
- end
- end
|