Skip to content

Instantly share code, notes, and snippets.

@simonlehmann
Created February 17, 2017 08:39
Show Gist options
  • Select an option

  • Save simonlehmann/47501cdea4c5119730405e81525b47f6 to your computer and use it in GitHub Desktop.

Select an option

Save simonlehmann/47501cdea4c5119730405e81525b47f6 to your computer and use it in GitHub Desktop.

Revisions

  1. simonlehmann created this gist Feb 17, 2017.
    7 changes: 7 additions & 0 deletions forum.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Class Forum < ActiveRecord::Base
    belongs_to :user

    def collaborators
    User.with_any_role({ name: :admin, resource: self }, { name: :moderator, resource: self })
    end
    end