Module: Engine2::ActionInsertSupport
- Included in:
- InsertAction
- Defined in:
- lib/engine2/action.rb
Instance Method Summary collapse
Instance Method Details
#allocate_record(handler, json_rec) ⇒ Object
934 935 936 937 938 939 940 941 |
# File 'lib/engine2/action.rb', line 934 def allocate_record handler, json_rec record = super(handler, json_rec) 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 |