Skip to content

Commit

Permalink
refactored volunteering? method on event model
Browse files Browse the repository at this point in the history
  • Loading branch information
courtney authored and ultrasaurus committed May 30, 2012
1 parent dfa1497 commit 760ccdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@

# Ignore Redcar directory
.redcar/*

/coverage
2 changes: 1 addition & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def unvolunteer!(user)
end

def volunteering?(user)
VolunteerRsvp.where(:event_id => self.id, :user_id => user.id, :attending => true).present?
self.volunteer_rsvps.find{|r| r.user_id == user.id && r.attending}.present?
end

scope :upcoming, lambda { where('date >= ?', Time.now.utc.beginning_of_day) }
Expand Down

0 comments on commit 760ccdb

Please sign in to comment.