Commit b56a45db8c3f276c2828c2325ebbd20bbf857d9e
1 parent
edb090f0
Exists in
master
and in
11 other branches
rails4: reject! don't work with relation
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/helpers/events_helper.rb
@@ -24,7 +24,7 @@ module EventsHelper | @@ -24,7 +24,7 @@ module EventsHelper | ||
24 | end | 24 | end |
25 | 25 | ||
26 | def populate_calendar(selected_date, events) | 26 | def populate_calendar(selected_date, events) |
27 | - events.reject! {|event| !event.display_to?(user)} | 27 | + events = events.reject{ |event| !event.display_to? user } |
28 | calendar = Event.date_range(selected_date.year, selected_date.month).map do |date| | 28 | calendar = Event.date_range(selected_date.year, selected_date.month).map do |date| |
29 | [ | 29 | [ |
30 | # the day itself | 30 | # the day itself |