mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-03 19:24:48 +08:00
Merge pull request #8254 from scinote-eln/hotfix/1.39.1.2
February 2025 Hotfix 2
This commit is contained in:
commit
28b223a65f
4 changed files with 5 additions and 17 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.39.1.1
|
||||
1.39.1.2
|
||||
|
|
|
@ -29,7 +29,7 @@ module Lists
|
|||
end
|
||||
|
||||
def paginate_records
|
||||
@records = @records.page(@params[:page]).per(@params[:per_page]) if @params[:page].present?
|
||||
@records = @records.page(@params[:page]).per(@params[:per_page])
|
||||
end
|
||||
|
||||
def sort_direction(order_params)
|
||||
|
|
|
@ -112,20 +112,6 @@ class UserDataDeletion
|
|||
end
|
||||
|
||||
def self.destroy_notifications(user)
|
||||
# Find all notifications where user is the only reference
|
||||
# on the notification, and destroy all such notifications
|
||||
# (user_notifications are destroyed when notification is
|
||||
# destroyed). We try to do this efficiently (hence in_groups_of).
|
||||
nids_all = user.notifications.pluck(:id)
|
||||
nids_all.in_groups_of(1000, false) do |nids|
|
||||
Notification
|
||||
.where(id: nids)
|
||||
.joins(:user_notifications)
|
||||
.group('notifications.id')
|
||||
.having('count(notification_id) <= 1')
|
||||
.destroy_all
|
||||
end
|
||||
# Now, simply destroy all user notification relations left
|
||||
user.user_notifications.destroy_all
|
||||
user.notifications.in_batches(of: 1000).destroy_all
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
<head>
|
||||
<title><%= t("protocols.print.title") %></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<script src="<%= global_constants_path(format: :js) %>"></script>
|
||||
|
||||
<%= javascript_include_tag 'jquery_bundle' %>
|
||||
<%= javascript_include_tag 'application' %>
|
||||
<%= javascript_include_tag "handsontable.full" %>
|
||||
|
|
Loading…
Reference in a new issue