Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat expire not required documents #357

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
this version of AA is buggy and when sorting by association attribute…
…s there is no limit in query and returns whole dataset and that is too much
  • Loading branch information
tsubik committed Oct 18, 2022
commit ef641f4607ca79961a7bf18ab7cbbb25e42d9dfe
10 changes: 5 additions & 5 deletions app/admin/operator_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,30 +183,30 @@ def scoped_collection
column :country do |od|
od.required_operator_document.country
end
column 'Required Document', :required_operator_document, sortable: 'required_operator_documents.name' do |od|
column 'Required Document', :required_operator_document, sortable: 'required_operator_document_id' do |od|
if od.required_operator_document.present?
link_to od.required_operator_document.name, admin_required_operator_document_path(od.required_operator_document)
else
RequiredOperatorDocument.unscoped.find(od.required_operator_document_id).name
end
end
column :Type, sortable: 'required_operator_documents.type' do |od|
column :Type, sortable: false do |od|
if od.required_operator_document.present?
od.required_operator_document.type == 'RequiredOperatorDocumentFmu' ? 'Fmu' : 'Operator'
else
RequiredOperatorDocument.unscoped.find(od.required_operator_document_id).type
end
end
column :operator, sortable: 'operator_translations.name'
column :fmu, sortable: 'fmu_translations.name'
column :operator, sortable: 'operator_id'
column :fmu, sortable: 'fmu_id'
column 'Legal Category' do |od|
if od.required_operator_document.present?
od.required_operator_document.required_operator_document_group.name
else
RequiredOperatorDocument.unscoped.find(od.required_operator_document_id).required_operator_document_group.name
end
end
column :user, sortable: 'users.name'
column :user, sortable: 'user_id'
column :expire_date
column :start_date
column :created_at
Expand Down
4 changes: 2 additions & 2 deletions app/admin/operator_document_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@
column :country do |od|
od.required_operator_document.country
end
column 'Required Document', :required_operator_document, sortable: 'required_operator_documents.name' do |od|
column 'Required Document', :required_operator_document, sortable: 'required_operator_document_id' do |od|
if od.required_operator_document.present?
link_to od.required_operator_document.name, admin_required_operator_document_path(od.required_operator_document)
else
RequiredOperatorDocument.unscoped.find(od.required_operator_document_id).name
end
end
column :Type, sortable: 'required_operator_documents.type' do |od|
column :Type, sortable: false do |od|
if od.required_operator_document.present?
od.required_operator_document.type == 'RequiredOperatorDocumentFmu' ? 'Fmu' : 'Operator'
else
Expand Down