ruby-hyperloop / hyper-mesh

The project has moved to Hyperstack!! - Synchronization of active record models across multiple clients using Pusher, ActionCable, or Polling
https://hyperstack.org/
MIT License
22 stars 12 forks source link

do_not_synchronize isn't inherited #68

Open sfcgeorge opened 6 years ago

sfcgeorge commented 6 years ago
class ApplicationRecord < ActiveRecord::Base
  do_not_synchronize
end
catmando commented 6 years ago

its because the internal instance data is not being inherited correctly

sfcgeorge commented 6 years ago

I have started selectively putting do_not_synchronise in models that don't need to update live, to reduce broadcast traffic. It works fine like that.

Before I was trying to use it in ApplicationRecord to have it inherited but that didn't work. I guess it would be useful to have it be inherited, though it's also easy to patch with included. In fact sticking it in a Concern might work too.

catmando commented 6 years ago

probably need a way to turn it on and off then i.e. turn it off in ApplicationRecord, but then turn it back in specific modules.