lib/sync/actions.rb
def sync(resource, action, options = {})
      resources = [resource].flatten
      messages = resources.collect do |resource|
        all_partials(resource, sync_render_context).collect do |partial|
          partial.message(action)
        end
      end

      Sync.client.batch_publish(messages.flatten)
    end
# Render all resource sync'd partial to string and publish action
# to pubsub server with rendered resource messages
#
# resource - The ActiveModel resource
# action - The Symbol action to publish. One of :update, :destroy
# options - The Hash of options
#   scope - The ActiveModel resource to scope destroy channel to
#   
Render all resource sync'd partial to string and publish action
to pubsub server with rendered resource messages

The ActiveModel resource
action - The Symbol action to publish. One of :update, :destroy
options - The Hash of options
scope - The ActiveModel resource to scope destroy channel to
Render all resource sync ' d partial to string and publish action to pubsub server with rendered resource messages The ActiveModel resource action - The Symbol action to publish . One of : update : destroy options - The Hash of options scope - The ActiveModel resource to scope destroy channel to
def sync(resource, action, options = {})
      resources = [resource].flatten
      messages = resources.collect do |resource|
        all_partials(resource, sync_render_context).collect do |partial|
          partial.message(action)
        end
      end
      Sync.client.batch_publish(messages.flatten)
    end
def sync ( resource , action , options = { } ) resources = [ resource ] . flatten messages = resources . collect do | resource | all_partials ( resource , sync_render_context ) . collect do | partial | partial . message ( action ) end end Sync . client . batch_publish ( messages . flatten ) end
Render all resource sync'd partial to string and publish action
to pubsub server with rendered resource messages
Render all resource sync ' d partial to string and publish action to pubsub server with rendered resource messages
resource
action
options