Skip to content

Commit 2c5b40d

Browse files
committed
fix a error
1 parent 78eeb8e commit 2c5b40d

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ GEM
129129
bigdecimal
130130
rexml
131131
crass (1.0.6)
132-
csv (3.3.4)
132+
csv (3.3.5)
133133
date (3.4.1)
134134
date (3.4.1-java)
135135
debug_inspector (1.2.0)
@@ -511,7 +511,7 @@ GEM
511511
logger
512512
rack (>= 2.2.4)
513513
redis-client (>= 0.22.2)
514-
sidekiq-scheduler (6.0.0)
514+
sidekiq-scheduler (6.0.1)
515515
rufus-scheduler (~> 3.2)
516516
sidekiq (>= 7.3, < 9)
517517
simplecov (0.22.0)
@@ -579,15 +579,15 @@ DEPENDENCIES
579579
binding_of_caller (~> 1.0, >= 1.0.1)
580580
bootsnap (~> 1.18, >= 1.18.6)
581581
brakeman (~> 7.0, >= 7.0.2)
582-
bullet (~> 8.0, >= 8.0.7)
582+
bullet (~> 8.0, >= 8.0.8)
583583
carrierwave (~> 3.1, >= 3.1.2)
584584
carrierwave-base64 (~> 2.11)
585585
carrierwave-bombshelter (~> 0.2, >= 0.2.2)
586586
case_transform (~> 0.2)
587587
colorize (~> 1.1)
588588
consistency_fail
589589
counter_culture (~> 3.10, >= 3.10.1)
590-
csv (~> 3.3, >= 3.3.4)
590+
csv (~> 3.3, >= 3.3.5)
591591
doorkeeper (~> 5.8, >= 5.8.2)
592592
doorkeeper-i18n (~> 5.2, >= 5.2.7)
593593
dotenv-rails (~> 3.1, >= 3.1.8)
@@ -625,7 +625,7 @@ DEPENDENCIES
625625
redis (~> 5.4)
626626
roo (~> 2.10, >= 2.10.1)
627627
rspec-rails (~> 8.0)
628-
rubocop (~> 1.75, >= 1.75.6)
628+
rubocop (~> 1.75, >= 1.75.8)
629629
rubocop-factory_bot (~> 2.27, >= 2.27.1)
630630
rubocop-performance (~> 1.25)
631631
rubocop-rails (~> 2.32)
@@ -638,7 +638,7 @@ DEPENDENCIES
638638
sentry-sidekiq (~> 5.24)
639639
sepa_king (~> 0.14)
640640
sidekiq (~> 7.3, >= 7.3.9)
641-
sidekiq-scheduler (~> 6.0)
641+
sidekiq-scheduler (~> 6.0, >= 6.0.1)
642642
simplecov (~> 0.22)
643643
simplecov-lcov (~> 0.8)
644644
spring (~> 4.3)

app/models/photo_comment.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ class PhotoComment < ApplicationRecord
77
validates :content, presence: true, length: { minimum: 1, maximum: 500 }
88

99
scope :alumni_visible, lambda { |start_date, end_date|
10-
joins(photo: :photo_album).where(
11-
<<~SQL.squish,
12-
photo_albums.visibility IN ('alumni','public')
13-
OR (photo_albums.date IS NOT NULL AND photo_albums.date BETWEEN :start_date AND :end_date)
14-
OR (photo_albums.date IS NULL AND photo_albums.created_at BETWEEN :start_date AND :end_date)
15-
SQL
16-
start_date: start_date,
17-
end_date: end_date
18-
)
10+
joins(:photo).merge(Photo.alumni_visible(start_date, end_date))
1911
}
2012
end

app/policies/photo_policy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ class Scope < ApplicationPolicy::Scope
33
def resolve # rubocop:disable Metrics/AbcSize
44
if user_can_read?
55
membership = user.memberships.joins(:group).where(groups: { name: 'Leden' }).first
6-
return scope.publicly_visible if membership.nil?
6+
return scope.none if membership.nil?
77

88
scope.alumni_visible(
99
membership.start_date&.advance(months: -18),
1010
membership.end_date&.advance(months: 6)
1111
)
1212
else
13-
scope.publicly_visible
13+
scope.none
1414
end
1515
end
1616
end

0 commit comments

Comments
 (0)