From f448a1651a1514a9e7c6cea7081af4f8717c1d01 Mon Sep 17 00:00:00 2001 From: Christopher Bull Date: Tue, 29 May 2012 16:49:09 +1200 Subject: [PATCH] @scope seems to be deprecated - updated the readme to reflect options[:scope] --- README.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.markdown b/README.markdown index 07cde73b..6bed51f5 100644 --- a/README.markdown +++ b/README.markdown @@ -126,12 +126,12 @@ class PostSerializer < ActiveModel::Serializer # only let the user see comments he created. def comments - post.comments.where(:created_by => @scope) + post.comments.where(:created_by => options[:scope]) end end ``` -In a serializer, `@scope` is the current authorization scope (usually +In a serializer, `options[:scope]` is the current authorization scope (usually `current_user`), which the controller gives to the serializer when you call `render :json`