Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.19_fix.3'
Browse files Browse the repository at this point in the history
* hotfix/0.2.19_fix.3:
  fix member scopes
  • Loading branch information
kalashnikovisme committed Jun 26, 2015
2 parents d149c69 + a7b3d8f commit 9ac1948
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/scopes/member_scopes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module MemberScopes

included do
scope :presented, -> { where('member_state != \'removed\' AND member_state != \'not_member\'').order('ticket ASC') }
scope :confirmed, -> { where(member_state: :confirmed).where.not(ticket: nil).order('ticket DESC') }
scope :declined, -> { where(member_state: :declined).order('ticket DESC') }
scope :confirmed, -> { where(member_state: :confirmed).where.not(ticket: nil, state: :unavailable).order('ticket DESC') }
scope :declined, -> { where(member_state: :declined).where.not(state: :unavailable).order('ticket DESC') }
scope :removed, -> { where(member_state: :removed).order('ticket DESC') }
scope :unviewed, -> { where(member_state: :unviewed, type: 'Member').order('id ASC') }
scope :unviewed, -> { where(member_state: :unviewed, type: 'Member').where.not(state: :unavailable).order('id ASC') }
scope :unavailable, -> { where(state: :unavailable).order('ticket ASC') }
end
end

0 comments on commit 9ac1948

Please sign in to comment.