@errors is an instance variable. If no errors are found, it will be `nil`
anyway.


On Sat, Mar 8, 2014 at 9:40 AM, Arpit Goyal <notifications@github.com>wrote:

> In plugins/020-shares/app/controllers/shares_controller.rb:
>
> >  		end
> > -		render :json => { :status => @saved ? :ok : :not_acceptable }
> > +		render :json => { :status => @saved ? :ok : :not_acceptable,
> > +		                  :errors => @errors }
>
> @errors <https://github.com/errors> = @workgroup.errors.any?
>
> render :json => { :status => @saved <https://github.com/saved> ? :ok :
> :not_acceptable, :errors => @errors <https://github.com/errors>?
> @errors.full_messages.join(',') : '' }
>
> This way, you are sure errors are set to empty if @saved<https://github.com/saved>
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/amahi/platform/pull/24/files#r10407853>
> .
>



-- 
-Ankur Goel