lib/anycable/rails/actioncable/connection.rb in anycable-rails-0.5.4 vs lib/anycable/rails/actioncable/connection.rb in anycable-rails-0.5.5
- old
+ new
@@ -89,10 +89,11 @@
# Converts GlobalID compatible vars to corresponding global IDs params.
def identifiers_hash
identifiers.each_with_object({}) do |id, acc|
obj = instance_variable_get("@#{id}")
next unless obj
+
acc[id] = obj.try(:to_gid_param) || obj
end
end
def identifiers_json
@@ -102,9 +103,10 @@
# Fetch identifier and deserialize if neccessary
def fetch_identifier(name)
@cached_ids[name] ||= @cached_ids.fetch(name) do
val = @ids[name.to_s]
next val unless val.is_a?(String)
+
GlobalID::Locator.locate(val) || val
end
end
def logger