Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

converted person_decorator to Draper

  • Loading branch information...
commit 6d7f0d1a6d5e3f9e1dfc8d085897e5fcc3248dff 1 parent 597704c
@seejee seejee authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 app/decorators/person_decorator.rb
View
12 app/decorators/person_decorator.rb
@@ -1,14 +1,10 @@
-class PersonDecorator
- extend Forwardable
+class PersonDecorator < ApplicationDecorator
+ decorates :person, :class => Clubhouse::Client::Person
- def_delegators :@person, :name, :email, :github_nickname, :permissions
-
- def initialize(person)
- @person = person
- end
+ allows :name, :email, :github_nickname, :permissions
def has_role?(role, course)
- membership = course.course_memberships.for_person(@person).first
+ membership = course.course_memberships.for_person(person).first
membership.has_role?(role) if membership
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.