Skip to content

Commit 150b3f8

Browse files
committed
fixed failing spec due to the additional serialized key in the columns hash
1 parent 23c2dd6 commit 150b3f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,10 @@ def server_method(name, default: nil)
342342
def define_attribute_methods
343343
columns_hash.each do |name, column_hash|
344344
next if name == primary_key
345-
column_hash[:serialized?] = ReactiveRecord::Base.serialized?[self][name]
345+
# only add serialized key if its serialized. This just makes testing a bit
346+
# easier by keeping the columns_hash the same if there are no seralized strings
347+
# see rspec ./spec/batch1/column_types/column_type_spec.rb:100
348+
column_hash[:serialized?] = true if ReactiveRecord::Base.serialized?[self][name]
346349
define_method(name) { @backing_record.get_attr_value(name, nil) }
347350
define_method("#{name}!") { @backing_record.get_attr_value(name, true) }
348351
define_method("#{name}=") { |val| @backing_record.set_attr_value(name, val) }

0 commit comments

Comments
 (0)