Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
e86e8c96
Commit
e86e8c96
authored
Sep 27, 2017
by
pierre.tremouilhac
Browse files
Merge branch 'adv-search-order-bug' into 'development'
Fix advanced search order bug See merge request ComPlat/chemotion_ELN!461
parents
e0cb637a
4d2c0143
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/api/chemotion/search_api.rb
View file @
e86e8c96
...
...
@@ -142,12 +142,15 @@ module Chemotion
molecules:
create_group_molecule
(
molecule_scope
,
sample_scope
)
}
else
ids
=
Kaminari
.
paginate_array
(
samples
).
page
(
page
).
per
(
page_size
)
id_array
=
Kaminari
.
paginate_array
(
samples
).
page
(
page
).
per
(
page_size
)
ids
=
id_array
.
join
(
','
)
paging_samples
=
Sample
.
includes
(
:residues
,
:tag
,
collections: :sync_collections_users
,
molecule: :tag
).
where
(
id:
ids
).
order
(
"position(id::text in '
#{
ids
}
')"
).
to_a
).
where
(
id:
id_array
).
order
(
"position(','||id::text||',' in ',
#{
ids
}
,')"
).
to_a
if
search_method
==
'advanced'
# sort by order - advanced search
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment