Closed dummied closed 8 years ago
https://github.com/SherSpock/muscle-wizards/blob/master/app/controllers/application_controller.rb#L16-L20
If I understand its purpose, something like:
def other_user(user) @prep.athlete == user ? @prep.coach : @prep.athlete end
More than that, I'd be inclined to make it a method on Prep instead.
Prep
def other_party(user) user == athlete ? coach : athlete end
Then, when you use this (getting to those in other issues), you can use @prep.other_party(current_user) instead.
@prep.other_party(current_user)
https://github.com/SherSpock/muscle-wizards/blob/master/app/controllers/application_controller.rb#L16-L20
If I understand its purpose, something like:
More than that, I'd be inclined to make it a method on
Prep
instead.Then, when you use this (getting to those in other issues), you can use
@prep.other_party(current_user)
instead.