Skip to content

Commit 517f39e

Browse files
committed
potential fix to hyperstack-org#276
1 parent 7c15d1f commit 517f39e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ruby/hyper-model/lib/reactive_record/active_record/class_methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def define_attribute_methods
363363
# easier by keeping the columns_hash the same if there are no seralized strings
364364
# see rspec ./spec/batch1/column_types/column_type_spec.rb:100
365365
column_hash[:serialized?] = true if ReactiveRecord::Base.serialized?[self][name]
366-
366+
367367
define_method(name) { @backing_record.get_attr_value(name, nil) } unless method_defined?(name)
368368
define_method("#{name}!") { @backing_record.get_attr_value(name, true) } unless method_defined?("#{name}!")
369369
define_method("#{name}=") { |val| @backing_record.set_attr_value(name, val) } unless method_defined?("#{name}=")
@@ -410,7 +410,7 @@ def _react_param_conversion(param, opt = nil)
410410
if key == poly_assoc.polymorphic_type_attribute
411411
model_name = value
412412
already_processed_keys << poly_assoc.association_foreign_key
413-
elsif key == poly_assoc.association_foreign_key
413+
elsif key == poly_assoc.association_foreign_key && poly_assoc.polymorphic_type_attribute
414414
model_id = value
415415
already_processed_keys << poly_assoc.polymorphic_type_attribute
416416
end

0 commit comments

Comments
 (0)