Guest User

Untitled

a guest
Jul 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def events_for(current_profile = nil, with_w2b = false)
  2. if current_profile
  3. if current_profile.editor? || current_profile.admin?
  4. events
  5. elsif current_profile == self
  6. with_w2b ? (events + Event.w2b.published).uniq : events
  7. else
  8. events_published
  9. end
  10. else
  11. events_published
  12. end
  13. end
Add Comment
Please, Sign In to add comment