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

      Sync.client.batch_publish(messages.flatten)
    end
# Render all sync'd partials for resource to string and publish 
# new action to pubsub server with rendered resource messages
#
# resource - The ActiveModel resource, or Array of ActiveModel resources
# 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 sync'd partials for resource to string and publish
new action to pubsub server with rendered resource messages

The ActiveModel resource, or Array of ActiveModel resources
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 sync ' d partials for resource to string and publish new action to pubsub server with rendered resource messages The ActiveModel resource or Array of ActiveModel resources 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_new(resource, options = {})
      scope = options[:scope]
      resources = [resource].flatten
      messages = resources.collect do |resource|
        all_partials(resource, sync_render_context).collect do |partial|
          partial.creator_for_scope(scope).message
        end
      end
      Sync.client.batch_publish(messages.flatten)
    end
def sync_new ( resource , options = { } ) scope = options [ :scope ] resources = [ resource ] . flatten messages = resources . collect do | resource | all_partials ( resource , sync_render_context ) . collect do | partial | partial . creator_for_scope ( scope ) . message end end Sync . client . batch_publish ( messages . flatten ) end
Render all sync'd partials for resource to string and publish
new action to pubsub server with rendered resource messages
Render all sync ' d partials for resource to string and publish new action to pubsub server with rendered resource messages
resource
options