diff --git a/app/models/plan.rb b/app/models/plan.rb index 186c2c6..c89b793 100644 --- a/app/models/plan.rb +++ b/app/models/plan.rb @@ -975,9 +975,25 @@ role.user_id = user_id role.plan_id = id - role.creator= is_creator - role.editor= is_editor - role.administrator= is_administrator + # if you get assigned a role you can comment + role.commenter= true + + # the rest of the roles are inclusing so creator => administrator => editor + if is_creator + role.creator = true + role.administrator = true + role.editor = true + end + + if is_administrator + role.administrator = true + role.editor = true + end + + if is_editor + role.editor = true + end + role.save # This is necessary because we're creating the associated record but not assigning it