summaryrefslogtreecommitdiff
path: root/app/views/admin/participants/show.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin/participants/show.html.haml')
-rw-r--r--app/views/admin/participants/show.html.haml24
1 files changed, 12 insertions, 12 deletions
diff --git a/app/views/admin/participants/show.html.haml b/app/views/admin/participants/show.html.haml
index d230446..033175d 100644
--- a/app/views/admin/participants/show.html.haml
+++ b/app/views/admin/participants/show.html.haml
@@ -99,12 +99,12 @@
- eventsm = 10
-- events_count = Event.for_participant(@participant,-1).uniq.count
+- events_count = Event.for_participant(@participant,-1).distinct.count
- if events_count < eventsm or events_count < 5
- - events_first = Event.for_participant(@participant,-1).uniq
+ - events_first = Event.for_participant(@participant,-1).distinct
-else
- - events_first = Event.for_participant(@participant,-1).uniq.limit(eventsm/2)
- - events_last = Event.for_participant(@participant,-1).uniq.limit(eventsm/2).offset(events_count-(eventsm/2))
+ - events_first = Event.for_participant(@participant,-1).distinct.limit(eventsm/2)
+ - events_last = Event.for_participant(@participant,-1).distinct.limit(eventsm/2).offset(events_count-(eventsm/2))
- events_diff = events_last - events_first
- unless events_first.blank?
%p
@@ -143,12 +143,12 @@
- msgsm = 10
-- messages_count = Message.for_participant_receiver(@participant).for_not_removed.uniq.count
+- messages_count = Message.for_participant_receiver(@participant).for_not_removed.distinct.count
- if messages_count < msgsm or messages_count < 5
- - messages_first = Message.for_participant_receiver(@participant).for_not_removed.uniq
+ - messages_first = Message.for_participant_receiver(@participant).for_not_removed.distinct
-else
- - messages_first = Message.for_participant_receiver(@participant).for_not_removed.uniq.limit(msgsm/2)
- - messages_last = Message.for_participant_receiver(@participant).for_not_removed.uniq.limit(msgsm/2).offset(messages_count-(msgsm/2))
+ - messages_first = Message.for_participant_receiver(@participant).for_not_removed.distinct.limit(msgsm/2)
+ - messages_last = Message.for_participant_receiver(@participant).for_not_removed.distinct.limit(msgsm/2).offset(messages_count-(msgsm/2))
- messages_diff = messages_last - messages_first
- unless messages_first.blank?
%p
@@ -187,12 +187,12 @@
- msgsm = 10
-- messages_count = Message.for_participant_sender(@participant).for_not_removed.uniq.count
+- messages_count = Message.for_participant_sender(@participant).for_not_removed.distinct.count
- if messages_count < msgsm or messages_count < 5
- - messages_first = Message.for_participant_sender(@participant).for_not_removed.uniq
+ - messages_first = Message.for_participant_sender(@participant).for_not_removed.distinct
-else
- - messages_first = Message.for_participant_sender(@participant).for_not_removed.uniq.limit(msgsm/2)
- - messages_last = Message.for_participant_sender(@participant).for_not_removed.uniq.limit(msgsm/2).offset(messages_count-(msgsm/2))
+ - messages_first = Message.for_participant_sender(@participant).for_not_removed.distinct.limit(msgsm/2)
+ - messages_last = Message.for_participant_sender(@participant).for_not_removed.distinct.limit(msgsm/2).offset(messages_count-(msgsm/2))
- messages_diff = messages_last - messages_first
- unless messages_first.blank?
%p