intermine 0.99.00 → 0.99.01
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/intermine/query.rb +5 -2
- data/lib/intermine/version.rb +2 -1
- data/test/test_query.rb +6 -0
- metadata +3 -3
data/lib/intermine/query.rb
CHANGED
@@ -723,8 +723,11 @@ module InterMine::PathQuery
|
|
723
723
|
#
|
724
724
|
def add_sort_order(path, direction="ASC")
|
725
725
|
p = self.path(path)
|
726
|
-
|
727
|
-
|
726
|
+
selected = @views.map {|v| v.prefix}
|
727
|
+
selected.push(@constraints.map {|c| c.path.is_attribute? ? c.path.prefix : c.path })
|
728
|
+
selected.uniq!
|
729
|
+
if !selected.include? p.prefix
|
730
|
+
raise ArgumentError, "Sort order (#{p}) not on a selected class (#{selected.map {|v| v.to_s}.inspect} in #{self.name || 'unnamed query'})"
|
728
731
|
end
|
729
732
|
@sort_order << SortOrder.new(p, direction)
|
730
733
|
return self
|
data/lib/intermine/version.rb
CHANGED
@@ -14,5 +14,6 @@ module Intermine
|
|
14
14
|
# 0.98.08 - Added column summary support
|
15
15
|
# 0.99.00 - Added coercion from query to lists in "IN/NOT IN" constraints
|
16
16
|
# - Added support for "json" format (performance) improvement
|
17
|
-
|
17
|
+
# 0.99.01 - Added support for sort-orders on selected classes which are not in the view
|
18
|
+
VERSION = "0.99.01"
|
18
19
|
end
|
data/test/test_query.rb
CHANGED
@@ -848,6 +848,12 @@ class TestQuery < Test::Unit::TestCase
|
|
848
848
|
|
849
849
|
assert_equal(query.sort_order.last.path, "Employee.name")
|
850
850
|
assert_equal(query.sort_order.last.direction, "DESC")
|
851
|
+
|
852
|
+
query.add_sort_order("fullTime")
|
853
|
+
|
854
|
+
assert_equal(query.sort_order.last.path, "Employee.fullTime")
|
855
|
+
assert_equal(query.sort_order.last.direction, "ASC")
|
856
|
+
|
851
857
|
end
|
852
858
|
|
853
859
|
def test_subclassed_sort_order
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intermine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 401
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 99
|
9
|
-
-
|
10
|
-
version: 0.99.
|
9
|
+
- 1
|
10
|
+
version: 0.99.01
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alex Kalderimis
|