Class: Engine2::InsertMeta
- Defined in:
- lib/engine2/meta/save_meta.rb
Instance Attribute Summary
Attributes included from MetaApproveSupport
Attributes inherited from Meta
#action, #assets, #invokable, #static
Instance Method Summary collapse
Methods inherited from SaveMeta
Methods included from MetaApproveSupport
#after_approve, #before_approve, #invoke, #post_run, #record, #validate, #validate_and_approve, #validate_fields, #validate_record
Methods included from MetaModelSupport
#action_defined, #get_type_info, #hide_pk, #pre_run, #show_pk, #unsupported_association
Methods inherited from Meta
#action_defined, #check_static_meta, #dynamic?, #freeze_meta, #get, http_method, #http_method, inherited, #initialize, #invoke!, #lookup, #merge, #meta_type, meta_type, #post_process, #post_run, #pre_run, #request, #request_meta_proc_params, #response, #split_keys
Constructor Details
This class inherits a constructor from Engine2::Meta
Instance Method Details
#allocate_record(handler, json) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/engine2/meta/save_meta.rb', line 32 def allocate_record handler, json record = super(handler, json) record.instance_variable_set(:"@new", true) model = assets[:model] model.primary_keys.each{|k|record.values.delete k} unless model.natural_key handler.permit !record.has_primary_key? unless model.natural_key record end |