lib/rails/graphql/subscription/store/base.rb in rails-graphql-1.0.0.beta vs lib/rails/graphql/subscription/store/base.rb in rails-graphql-1.0.0.rc1
- old
+ new
@@ -63,10 +63,15 @@
# Remove a given subscription from the store by its id or instance
def remove(item)
raise NotImplementedError, +"#{self.class.name} does not implement remove"
end
+ # Marks that a subscription has received an update
+ def update!(item)
+ raise NotImplementedError, +"#{self.class.name} does not implement update!"
+ end
+
# Check if a given sid or instance is stored
def has?(item)
raise NotImplementedError, +"#{self.class.name} does not implement has?"
end
@@ -121,23 +126,14 @@
# it as part of the hash (similar to how ActiveRecord calculates
# the hash for a model's record)
def hash_for(value, klass = nil)
if !klass.nil?
klass.hash ^ value.hash
- elsif extract_class_from?(value)
- value.class.hash ^ value.id.hash
elsif value.is_a?(Numeric)
value
else
value.hash
end
- end
-
- # Check if ActiveRecord::Base is available and then if the object
- # provided is an instance of it, so that the serialize can work
- # correctly
- def extract_class_from?(value)
- defined?(ActiveRecord) && value.is_a?(ActiveRecord::Base)
end
end
end
end
end