remove it!!


On Mon, Nov 4, 2013 at 5:13 PM, john irving <notifications@github.com>wrote:

> In app/models/discussion.rb:
>
> > @@ -45,12 +45,13 @@ def as_read_by(user)
> >      end
> >    end
> >
> > -  def add_comment(user, comment, options={} )
> > -    if user.can?(:add_comment, self)
> > -      comment = Comment.build_from self, user, comment, options
> > -      comment.save!
> > -      comment
> > -    end
> > +  def add_comment(author, body, options = {})
> > +    options[:body] = body
> > +    comment = Comment.new(options)
> > +    comment.author = author
> > +    comment.discussion = self
> > +    DiscussionService.add_comment(comment)
> > +    comment
>
> yeah something like #do not use, to be deprecated
>
> alternatively, .add_comment isn't actually too many places in the code
> base. The only catch I think is that changing it is going to temporarily
> break a few tests.
> a) If this would be a useful thing to do I'm happy to do it
> b) If there are no real gains we leave it with a comment
>
> pick-a-path
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/loomio/loomio/pull/1146/files#r7393880>
> .
>