Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wicz/liskov
Browse files Browse the repository at this point in the history
* 'master' of github.com:wicz/liskov:
  converted person_decorator to Draper
  • Loading branch information
wicz committed Mar 20, 2012
2 parents 597704c + c76984d commit 7cc75f7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions 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

0 comments on commit 7cc75f7

Please sign in to comment.