This is the method which the with: at the top references.
It checks if the error is associated with a discussion id which is know. If
it is, you get a 'nice' error telling you the discussion might have been
deleted or something. If it's a non existent/known discussion, the method
should just display the error as it would have previously been displayed. I
think this is what the raise does?
On 7/09/2013 3:25 pm, "Robert Guthrie" <notifications@github.com> wrote:

> In app/controllers/discussions_controller.rb:
>
> > @@ -196,4 +197,13 @@ def find_group
> >        Group.find(params[:discussion][:group_id])
> >      end
> >    end
> > +
> > +  def check_valid_discussion
> > +    if Discussion.where(id: params[:id])
> > +      render 'application/display_error', locals: { message: t('error.not_found') }
> > +    else
> > +      raise ActiveRecord::RecordNotFound
>
> I can't understand what this is trying to do.. Can someone explain the
> intention please? @s01us <https://github.com/s01us> @jdoud<https://github.com/jdoud>
> @HSalmon <https://github.com/HSalmon>?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/loomio/loomio/pull/1011/files#r6223818>
> .
>