Compare commits
No commits in common. "05c8e7f6180bb445eb4d756369d08634adf9bbb4" and "bec350e9f2099884207f30cf0fe925d5adbd4578" have entirely different histories.
05c8e7f618
...
bec350e9f2
2 changed files with 19 additions and 22 deletions
|
@ -19,27 +19,29 @@ class ClosetHanger < ApplicationRecord
|
||||||
}
|
}
|
||||||
scope :trading, -> {
|
scope :trading, -> {
|
||||||
ch = arel_table
|
ch = arel_table
|
||||||
# sigh… our default-lists continue to be a pain
|
|
||||||
cl = ClosetList.arel_table
|
cl = ClosetList.arel_table
|
||||||
u = User.arel_table
|
u = User.arel_table
|
||||||
joins(:user).left_outer_joins(:list).where(
|
joins(:user, :list).where(
|
||||||
ch[:list_id].not_eq(nil).and(cl[:visibility].gteq(
|
# sigh… our default-lists continue to be a pain
|
||||||
|
(
|
||||||
|
ch[:list_id].not_eq(nil).and(cl[:visibility].gteq(
|
||||||
ClosetVisibility[:trading].id))
|
ClosetVisibility[:trading].id))
|
||||||
).or(where(
|
).or(
|
||||||
(
|
(
|
||||||
ch[:list_id].eq(nil).and(ch[:owned].eq(true))
|
ch[:list_id].eq(nil).and(ch[:owned].eq(true))
|
||||||
).and(
|
).and(
|
||||||
u[:owned_closet_hangers_visibility].gteq(
|
u[:owned_closet_hangers_visibility].gteq(
|
||||||
ClosetVisibility[:trading].id)
|
ClosetVisibility[:trading].id)
|
||||||
|
)
|
||||||
|
).or(
|
||||||
|
(
|
||||||
|
ch[:list_id].eq(nil).and(ch[:owned].eq(false))
|
||||||
|
).and(
|
||||||
|
u[:wanted_closet_hangers_visibility].gteq(
|
||||||
|
ClosetVisibility[:trading].id)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)).or(where(
|
)
|
||||||
(
|
|
||||||
ch[:list_id].eq(nil).and(ch[:owned].eq(false))
|
|
||||||
).and(
|
|
||||||
u[:wanted_closet_hangers_visibility].gteq(
|
|
||||||
ClosetVisibility[:trading].id)
|
|
||||||
)
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
scope :newest, -> { order(arel_table[:created_at].desc) }
|
scope :newest, -> { order(arel_table[:created_at].desc) }
|
||||||
scope :owned_before_wanted, -> { order(arel_table[:owned].desc) }
|
scope :owned_before_wanted, -> { order(arel_table[:owned].desc) }
|
||||||
|
|
|
@ -35,11 +35,6 @@
|
||||||
= list_zones @restricted_zones
|
= list_zones @restricted_zones
|
||||||
|
|
||||||
#trade-hangers
|
#trade-hangers
|
||||||
- if Time.now < Date.new(2024, 1, 26)
|
|
||||||
%p
|
|
||||||
✨⏳️
|
|
||||||
%i We now only show recently-updated lists here!
|
|
||||||
⏳️✨
|
|
||||||
- [true, false].each do |owned|
|
- [true, false].each do |owned|
|
||||||
%p
|
%p
|
||||||
%strong
|
%strong
|
||||||
|
|
Loading…
Reference in a new issue