Skip to content

Commit

Permalink
Merge pull request #495 from ZeusWPI/fix/495/registrations-grid-filte…
Browse files Browse the repository at this point in the history
…ring

Sorting by (un)paid AND access level fails
  • Loading branch information
TomNaessens committed Mar 24, 2015
2 parents 70d3fe3 + 7557446 commit 7ef16c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/grids/registrations_grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class RegistrationsGrid
filter(:email) { |value| where("lower(registrations.email) like ?", "%#{value.downcase}%") }
filter(:access_level) { |value, scope| scope.joins(:access_levels).where(access_levels: { id: value }) }
filter(:payment_code) { |value| where("registrations.payment_code like ?","%#{value}%") }
filter(:only_paid) { |value| where("paid = price") if value == '1' }
filter(:only_unpaid) { |value| where.not("paid = price") if value == '1' }
filter(:only_paid) { |value| where("registrations.paid = registrations.price") if value == '1' }
filter(:only_unpaid) { |value| where.not("registrations.paid = registrations.price") if value == '1' }

column(:name)
column(:email)
Expand Down

0 comments on commit 7ef16c7

Please sign in to comment.