Sha256: 446871c9977a45ad2de54dd280ace848ff9188aaa450626a6f10d7d8dff7943b
Contents?: true
Size: 437 Bytes
Versions: 7
Compression:
Stored size: 437 Bytes
Contents
class ActiveRecord::Base def self.to_sync(scope_name, opts={}, &block) watch_list = if opts[:watch] [*opts.delete[:watch]] else [self] end if RUBY_ENGINE=='opal' watch_list.each do |klass_to_watch| ReactiveRecord::Base.sync_blocks[klass_to_watch][self][scope_name] << block end else # this is where we put server side watchers in place to sync all clients! end end end
Version data entries
7 entries across 7 versions & 1 rubygems