on /d/new, only display groups that you can start a discussion in

@robguthrie I'm pretty confident this is providing the intended functionality, but I wonder how you feel about the clarity of what I've done?
thanks matey!


On 23 July 2014 11:39, James Kiesel <notifications@github.com> wrote:

> In app/models/user.rb:
>
> > @@ -48,6 +48,12 @@ class User < ActiveRecord::Base
> >    has_many :adminable_groups,
> >             through: :admin_memberships,
> >             class_name: 'Group',
> > +           conditions: {archived_at: nil},
> > +           source: :group
> > +
> > +  has_many :discussable_groups,
> > +           through: :memberships,
> > +           conditions: {members_can_start_discussions: true, archived_at: nil},
>
> FYI, this conditions parameter is deprecated and will have to be yanked
> out before an upgrade to 4.0
>
> I think the recommended way is:
>
> has_many :discussable_groups,
>   -> { where(members_can_start_discussions: true, archived_at: nil) },
>   through: memberships, #etc
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/loomio/loomio/pull/1584/files#r15263315>.
>



-- 

Richard D. Bartlett
Loomio co-founder
rich@loomio.org

<http://loomio.org/>