File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,14 @@ def to_hash_value
49
49
# Return a hash-representation of the given values for this field type
50
50
# that is safe to convert to JSON.
51
51
# The value in this case would be an array.
52
- def to_json_hash_value
52
+ def to_json_hash_value ( options = { } )
53
53
if field . respond_to? ( :json_encode )
54
54
map do |value |
55
55
field . json_encode ( value )
56
56
end
57
57
else
58
58
map do |value |
59
- value . respond_to? ( :to_json_hash_value ) ? value . to_json_hash_value : value
59
+ value . respond_to? ( :to_json_hash_value ) ? value . to_json_hash_value ( options ) : value
60
60
end
61
61
end
62
62
end
Original file line number Diff line number Diff line change @@ -58,14 +58,14 @@ def to_hash_value
58
58
# The value in this case would be the hash itself, right? Unfortunately
59
59
# not because the values of the map could be messages themselves that we
60
60
# need to transform.
61
- def to_json_hash_value
61
+ def to_json_hash_value ( options = { } )
62
62
if field . respond_to? ( :json_encode )
63
63
each_with_object ( { } ) do |( key , value ) , hash |
64
64
hash [ key ] = field . json_encode ( value )
65
65
end
66
66
else
67
67
each_with_object ( { } ) do |( key , value ) , hash |
68
- hash [ key ] = value . respond_to? ( :to_json_hash_value ) ? value . to_json_hash_value : value
68
+ hash [ key ] = value . respond_to? ( :to_json_hash_value ) ? value . to_json_hash_value ( options ) : value
69
69
end
70
70
end
71
71
end
You can’t perform that action at this time.
0 commit comments