Clean up rating partials

This commit is contained in:
James Mason 2018-02-09 17:19:33 -08:00
parent 73c5c3c97a
commit 9e10678542
10 changed files with 131 additions and 92 deletions

View file

@ -46,7 +46,7 @@ module Admin
@event_types = @program.event_types
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@ratings = @event.votes.includes(:user)
@votes = @event.votes.includes(:user)
@difficulty_levels = @program.difficulty_levels
@versions = @event.versions |
PaperTrail::Version.where(item_type: 'Commercial').where('object LIKE ?', "%commercialable_id: #{@event.id}\ncommercialable_type: Event%") |
@ -146,7 +146,7 @@ module Admin
end
def vote
@ratings = @event.votes.includes(:user)
@votes = @event.votes.includes(:user)
if (votes = current_user.votes.find_by_event_id(params[:id]))
votes.update_attributes(rating: params[:rating])