ransack 2.0.1 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +0 -5
- data/CHANGELOG.md +51 -0
- data/README.md +56 -4
- data/lib/polyamorous.rb +6 -23
- data/lib/ransack/adapters/active_record/base.rb +1 -0
- data/lib/ransack/adapters/active_record/context.rb +27 -13
- data/lib/ransack/adapters/active_record/ransack/visitor.rb +8 -4
- data/lib/ransack/locale/ar.yml +70 -0
- data/lib/ransack/locale/bg.yml +70 -0
- data/lib/ransack/locale/el.yml +70 -0
- data/lib/ransack/locale/zh-CN.yml +12 -12
- data/lib/ransack/version.rb +1 -1
- data/logo/ransack-h.png +0 -0
- data/logo/ransack-h.svg +34 -0
- data/logo/ransack-v.png +0 -0
- data/logo/ransack-v.svg +34 -0
- data/logo/ransack.png +0 -0
- data/logo/ransack.svg +21 -0
- data/spec/ransack/adapters/active_record/base_spec.rb +11 -4
- data/spec/ransack/helpers/form_helper_spec.rb +51 -51
- data/spec/support/schema.rb +3 -0
- metadata +11 -3
- data/lib/ransack/adapters/active_record/compat.rb +0 -14
@@ -0,0 +1,70 @@
|
|
1
|
+
el:
|
2
|
+
ransack:
|
3
|
+
search: "αναζήτηση"
|
4
|
+
predicate: "κατηγορούμενο"
|
5
|
+
and: "και"
|
6
|
+
or: "ή"
|
7
|
+
any: "οποιοδήποτε"
|
8
|
+
all: "όλα"
|
9
|
+
combinator: "συνδυαστής"
|
10
|
+
attribute: "ιδιότητα"
|
11
|
+
value: "τιμή"
|
12
|
+
condition: "συνθήκη"
|
13
|
+
sort: "ταξινόμηση"
|
14
|
+
asc: "αύξουσα"
|
15
|
+
desc: "φθίνουσα"
|
16
|
+
predicates:
|
17
|
+
eq: "ίσον"
|
18
|
+
eq_any: "ισούται με οποιοδήποτε"
|
19
|
+
eq_all: "ισούται με όλα"
|
20
|
+
not_eq: "άνισο"
|
21
|
+
not_eq_any: "άνισο με οποιοδήποτε"
|
22
|
+
not_eq_all: "άνισο με όλα"
|
23
|
+
matches: "αντιστοιχεί"
|
24
|
+
matches_any: "αντιστοιχεί με οποιοδήποτε"
|
25
|
+
matches_all: "αντιστοιχεί με όλα"
|
26
|
+
does_not_match: "δεν αντιστοιχεί"
|
27
|
+
does_not_match_any: "δεν αντιστοιχεί με οποιοδήποτε"
|
28
|
+
does_not_match_all: "δεν αντιστοιχεί με όλα"
|
29
|
+
lt: "μικρότερο από"
|
30
|
+
lt_any: "μικρότερο από οποιοδήποτε"
|
31
|
+
lt_all: "μικρότερο από όλα"
|
32
|
+
lteq: "μικρότερο ή ίσον"
|
33
|
+
lteq_any: "μικρότερο ή ίσον από οποιοδήποτε"
|
34
|
+
lteq_all: "μικρότερο ή ίσον από όλα"
|
35
|
+
gt: "μεγαλύτερο από"
|
36
|
+
gt_any: "μεγαλύτερο από οποιοδήποτε"
|
37
|
+
gt_all: μεγαλύτερο από όλα"
|
38
|
+
gteq: "μεγαλύτερο ή ίσον από"
|
39
|
+
gteq_any: "μεγαλύτερο ή ίσον από οποιοδήποτε"
|
40
|
+
gteq_all: "μεγαλύτερο ή ίσον από όλα"
|
41
|
+
in: "περιέχεται"
|
42
|
+
in_any: "περιέχεται σε οποιοδήποτε"
|
43
|
+
in_all: "περιέχεται σε όλα"
|
44
|
+
not_in: "δεν περιέχεται"
|
45
|
+
not_in_any: "δεν περιέχεται σε οποιοδήποτε"
|
46
|
+
not_in_all: "δεν περιέχεται σε όλα"
|
47
|
+
cont: "περιέχει"
|
48
|
+
cont_any: "περιέχει οποιοδήποτε"
|
49
|
+
cont_all: "περιέχει όλα"
|
50
|
+
not_cont: "δεν περιέχει"
|
51
|
+
not_cont_any: "δεν περιέχει οποιοδήποτε"
|
52
|
+
not_cont_all: "δεν περιέχει όλα"
|
53
|
+
start: "αρχίζει με"
|
54
|
+
start_any: "αρχίζει με οποιοδήποτε"
|
55
|
+
start_all: "αρχίζει με όλα"
|
56
|
+
not_start: "δεν αρχίζει με"
|
57
|
+
not_start_any: "δεν αρχίζει με οποιοδήποτε"
|
58
|
+
not_start_all: "δεν αρχίζει με όλα"
|
59
|
+
end: "τελειώνει με"
|
60
|
+
end_any: "τελειώνει οποιοδήποτε"
|
61
|
+
end_all: "τελειώνει με όλα"
|
62
|
+
not_end: "δεν τελειώνει με"
|
63
|
+
not_end_any: "δεν τελειώνει οποιοδήποτε"
|
64
|
+
not_end_all: "δεν τελειώνει με όλα"
|
65
|
+
'true': "αληθές"
|
66
|
+
'false': "ψευδές"
|
67
|
+
present: "υπάρχει"
|
68
|
+
blank: "είναι κενό"
|
69
|
+
'null': "άκυρο"
|
70
|
+
not_null: "δεν είναι άκυρο"
|
@@ -50,18 +50,18 @@ zh-CN:
|
|
50
50
|
not_cont: "不包含"
|
51
51
|
not_cont_any: "不包含任意一个值"
|
52
52
|
not_cont_all: "不包含所有值"
|
53
|
-
start: "
|
54
|
-
start_any: "
|
55
|
-
start_all: "
|
56
|
-
not_start: "
|
57
|
-
not_start_any: "
|
58
|
-
not_start_all: "
|
59
|
-
end: "
|
60
|
-
end_any: "
|
61
|
-
end_all: "
|
62
|
-
not_end: "
|
63
|
-
not_end_any: "
|
64
|
-
not_end_all: "
|
53
|
+
start: "始于"
|
54
|
+
start_any: "始于任一值"
|
55
|
+
start_all: "始于任意值"
|
56
|
+
not_start: "非始于"
|
57
|
+
not_start_any: "非始于任一值"
|
58
|
+
not_start_all: "非始于任意值"
|
59
|
+
end: "止于"
|
60
|
+
end_any: "止于任一值"
|
61
|
+
end_all: "止于任意值"
|
62
|
+
not_end: "非止于"
|
63
|
+
not_end_any: "非止于任一值"
|
64
|
+
not_end_all: "非止于任意值"
|
65
65
|
'true': "等于true"
|
66
66
|
'false': "等于false"
|
67
67
|
present: "有值"
|
data/lib/ransack/version.rb
CHANGED
data/logo/ransack-h.png
ADDED
Binary file
|
data/logo/ransack-h.svg
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 519 114" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
4
|
+
<g transform="matrix(1,0,0,1,-1217.17,-115.878)">
|
5
|
+
<g transform="matrix(1,0,0,1,1076.45,0)">
|
6
|
+
<g transform="matrix(1,0,0,1,-38.0018,0)">
|
7
|
+
<g transform="matrix(0.952133,0,0,0.952133,-804.114,-1490.95)">
|
8
|
+
<path d="M1032.25,1692.74C1032.25,1689.9 1034.55,1687.61 1037.38,1687.61C1052.29,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1136.6,1789.45 1143.57,1801.53C1144.18,1802.58 1144.18,1803.88 1143.57,1804.94C1142.96,1806 1141.83,1806.65 1140.61,1806.65C1130.61,1806.65 1110.85,1806.65 1104.56,1806.65C1103.34,1806.65 1102.21,1806 1101.6,1804.94C1097.46,1797.77 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1792.44 1073.76,1802.14C1073.76,1803.34 1073.29,1804.48 1072.44,1805.33C1071.6,1806.17 1070.45,1806.65 1069.25,1806.65C1061.27,1806.65 1044.74,1806.65 1036.76,1806.65C1035.56,1806.65 1034.41,1806.17 1033.57,1805.33C1032.72,1804.48 1032.25,1803.34 1032.25,1802.14C1032.25,1783.5 1032.25,1712.5 1032.25,1692.74Z" style="fill:url(#_Linear1);"/>
|
9
|
+
<clipPath id="_clip2">
|
10
|
+
<path d="M1032.25,1692.74C1032.25,1689.9 1034.55,1687.61 1037.38,1687.61C1052.29,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1136.6,1789.45 1143.57,1801.53C1144.18,1802.58 1144.18,1803.88 1143.57,1804.94C1142.96,1806 1141.83,1806.65 1140.61,1806.65C1130.61,1806.65 1110.85,1806.65 1104.56,1806.65C1103.34,1806.65 1102.21,1806 1101.6,1804.94C1097.46,1797.77 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1792.44 1073.76,1802.14C1073.76,1803.34 1073.29,1804.48 1072.44,1805.33C1071.6,1806.17 1070.45,1806.65 1069.25,1806.65C1061.27,1806.65 1044.74,1806.65 1036.76,1806.65C1035.56,1806.65 1034.41,1806.17 1033.57,1805.33C1032.72,1804.48 1032.25,1803.34 1032.25,1802.14C1032.25,1783.5 1032.25,1712.5 1032.25,1692.74Z"/>
|
11
|
+
</clipPath>
|
12
|
+
<g clip-path="url(#_clip2)">
|
13
|
+
<g transform="matrix(1.05537,0,0,1.05537,-56.2001,-93.6352)">
|
14
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.29,1771.75 1116.66,1782.78C1117.57,1784.36 1117.57,1786.31 1116.66,1787.89C1115.75,1789.47 1114.06,1790.44 1112.23,1790.44C1112.23,1790.44 1112.23,1790.44 1112.23,1790.44C1110.43,1790.44 1108.76,1789.48 1107.86,1787.92C1103.37,1780.15 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(52,52,107);fill-opacity:0.4;"/>
|
15
|
+
</g>
|
16
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.19,1771.58 1116.57,1782.63C1117.5,1784.24 1117.5,1786.23 1116.57,1787.84C1115.64,1789.45 1113.92,1790.44 1112.06,1790.44C1112.06,1790.44 1112.06,1790.44 1112.06,1790.44C1110.36,1790.44 1108.79,1789.54 1107.94,1788.07C1103.54,1780.44 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(251,248,255);"/>
|
17
|
+
</g>
|
18
|
+
</g>
|
19
|
+
<g transform="matrix(1,0,0,1,-37.1645,15.0997)">
|
20
|
+
<path d="M399.069,182.651L389.349,168.611L388.773,168.611L378.621,168.611L378.621,182.651L366.957,182.651L366.957,132.251L388.773,132.251C393.237,132.251 397.113,132.995 400.401,134.483C403.689,135.971 406.221,138.083 407.997,140.819C409.773,143.555 410.661,146.795 410.661,150.539C410.661,154.283 409.761,157.511 407.961,160.223C406.161,162.935 403.605,165.011 400.293,166.451L411.597,182.651L399.069,182.651ZM398.853,150.539C398.853,147.707 397.941,145.535 396.117,144.023C394.293,142.511 391.629,141.755 388.125,141.755L378.621,141.755L378.621,159.323L388.125,159.323C391.629,159.323 394.293,158.555 396.117,157.019C397.941,155.483 398.853,153.323 398.853,150.539Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
21
|
+
<path d="M453.069,171.851L429.669,171.851L425.205,182.651L413.253,182.651L435.717,132.251L447.237,132.251L469.773,182.651L457.533,182.651L453.069,171.851ZM449.397,162.995L441.405,143.699L433.413,162.995L449.397,162.995Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
22
|
+
<path d="M521.253,132.251L521.253,182.651L511.677,182.651L486.549,152.051L486.549,182.651L475.029,182.651L475.029,132.251L484.677,132.251L509.733,162.851L509.733,132.251L521.253,132.251Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
23
|
+
<path d="M549.765,183.515C545.781,183.515 541.929,182.975 538.209,181.895C534.489,180.815 531.501,179.411 529.245,177.683L533.205,168.899C535.365,170.483 537.933,171.755 540.909,172.715C543.885,173.675 546.861,174.155 549.837,174.155C553.149,174.155 555.597,173.663 557.181,172.679C558.765,171.695 559.557,170.387 559.557,168.755C559.557,167.555 559.089,166.559 558.153,165.767C557.217,164.975 556.017,164.339 554.553,163.859C553.089,163.379 551.109,162.851 548.613,162.275C544.773,161.363 541.629,160.451 539.181,159.539C536.733,158.627 534.633,157.163 532.881,155.147C531.129,153.131 530.253,150.443 530.253,147.083C530.253,144.155 531.045,141.503 532.629,139.127C534.213,136.751 536.601,134.867 539.793,133.475C542.985,132.083 546.885,131.387 551.493,131.387C554.709,131.387 557.853,131.771 560.925,132.539C563.997,133.307 566.685,134.411 568.989,135.851L565.389,144.707C560.733,142.067 556.077,140.747 551.421,140.747C548.157,140.747 545.745,141.275 544.185,142.331C542.625,143.387 541.845,144.779 541.845,146.507C541.845,148.235 542.745,149.519 544.545,150.359C546.345,151.199 549.093,152.027 552.789,152.843C556.629,153.755 559.773,154.667 562.221,155.579C564.669,156.491 566.769,157.931 568.521,159.899C570.273,161.867 571.149,164.531 571.149,167.891C571.149,170.771 570.345,173.399 568.737,175.775C567.129,178.151 564.717,180.035 561.501,181.427C558.285,182.819 554.373,183.515 549.765,183.515Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
24
|
+
<path d="M612.333,171.851L588.933,171.851L584.469,182.651L572.517,182.651L594.981,132.251L606.501,132.251L629.037,182.651L616.797,182.651L612.333,171.851ZM608.661,162.995L600.669,143.699L592.677,162.995L608.661,162.995Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
25
|
+
<path d="M657.693,183.515C652.557,183.515 647.913,182.399 643.761,180.167C639.609,177.935 636.345,174.839 633.969,170.879C631.593,166.919 630.405,162.443 630.405,157.451C630.405,152.459 631.593,147.983 633.969,144.023C636.345,140.063 639.609,136.967 643.761,134.735C647.913,132.503 652.581,131.387 657.765,131.387C662.133,131.387 666.081,132.155 669.609,133.691C673.137,135.227 676.101,137.435 678.501,140.315L671.013,147.227C667.605,143.291 663.381,141.323 658.341,141.323C655.221,141.323 652.437,142.007 649.989,143.375C647.541,144.743 645.633,146.651 644.265,149.099C642.897,151.547 642.213,154.331 642.213,157.451C642.213,160.571 642.897,163.355 644.265,165.803C645.633,168.251 647.541,170.159 649.989,171.527C652.437,172.895 655.221,173.579 658.341,173.579C663.381,173.579 667.605,171.587 671.013,167.603L678.501,174.515C676.101,177.443 673.125,179.675 669.573,181.211C666.021,182.747 662.061,183.515 657.693,183.515Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
26
|
+
<path d="M704.709,162.851L697.941,169.907L697.941,182.651L686.349,182.651L686.349,132.251L697.941,132.251L697.941,155.795L720.261,132.251L733.221,132.251L712.341,154.715L734.445,182.651L720.837,182.651L704.709,162.851Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
27
|
+
</g>
|
28
|
+
</g>
|
29
|
+
</g>
|
30
|
+
</g>
|
31
|
+
<defs>
|
32
|
+
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(121.538,125.482,-125.482,121.538,1032.25,1687.61)"><stop offset="0" style="stop-color:rgb(132,132,220);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(51,51,180);stop-opacity:1"/></linearGradient>
|
33
|
+
</defs>
|
34
|
+
</svg>
|
data/logo/ransack-v.png
ADDED
Binary file
|
data/logo/ransack-v.svg
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 291 223" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
4
|
+
<g transform="matrix(1,0,0,1,-1132.77,-491.089)">
|
5
|
+
<g transform="matrix(1,0,0,1,1076.45,0)">
|
6
|
+
<g transform="matrix(1.25996,0,0,1.25996,-1171.73,-1635.23)">
|
7
|
+
<path d="M1032.25,1691.49C1032.25,1689.34 1033.99,1687.61 1036.13,1687.61C1049.74,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1137.85,1791.63 1144.29,1802.78C1144.75,1803.58 1144.75,1804.56 1144.29,1805.36C1143.83,1806.16 1142.98,1806.65 1142.05,1806.65C1132.41,1806.65 1110.05,1806.65 1104.08,1806.65C1103.15,1806.65 1102.3,1806.16 1101.84,1805.36C1098.12,1798.91 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1794.23 1073.76,1803.24C1073.76,1805.12 1072.24,1806.65 1070.35,1806.65C1062.55,1806.65 1043.46,1806.65 1035.66,1806.65C1034.75,1806.65 1033.89,1806.29 1033.25,1805.65C1032.61,1805.01 1032.25,1804.14 1032.25,1803.24C1032.25,1786.12 1032.25,1709.65 1032.25,1691.49Z" style="fill:url(#_Linear1);"/>
|
8
|
+
<clipPath id="_clip2">
|
9
|
+
<path d="M1032.25,1691.49C1032.25,1689.34 1033.99,1687.61 1036.13,1687.61C1049.74,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1137.85,1791.63 1144.29,1802.78C1144.75,1803.58 1144.75,1804.56 1144.29,1805.36C1143.83,1806.16 1142.98,1806.65 1142.05,1806.65C1132.41,1806.65 1110.05,1806.65 1104.08,1806.65C1103.15,1806.65 1102.3,1806.16 1101.84,1805.36C1098.12,1798.91 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1794.23 1073.76,1803.24C1073.76,1805.12 1072.24,1806.65 1070.35,1806.65C1062.55,1806.65 1043.46,1806.65 1035.66,1806.65C1034.75,1806.65 1033.89,1806.29 1033.25,1805.65C1032.61,1805.01 1032.25,1804.14 1032.25,1803.24C1032.25,1786.12 1032.25,1709.65 1032.25,1691.49Z"/>
|
10
|
+
</clipPath>
|
11
|
+
<g clip-path="url(#_clip2)">
|
12
|
+
<g transform="matrix(1.05537,0,0,1.05537,-56.2001,-93.6352)">
|
13
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.29,1771.75 1116.66,1782.78C1117.57,1784.36 1117.57,1786.31 1116.66,1787.89C1115.75,1789.47 1114.06,1790.44 1112.23,1790.44C1112.23,1790.44 1112.23,1790.44 1112.23,1790.44C1110.43,1790.44 1108.76,1789.48 1107.86,1787.92C1103.37,1780.15 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(52,52,107);fill-opacity:0.4;"/>
|
14
|
+
</g>
|
15
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.19,1771.58 1116.57,1782.63C1117.5,1784.24 1117.5,1786.23 1116.57,1787.84C1115.64,1789.45 1113.92,1790.44 1112.06,1790.44C1112.06,1790.44 1112.06,1790.44 1112.06,1790.44C1110.36,1790.44 1108.79,1789.54 1107.94,1788.07C1103.54,1780.44 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(251,248,255);"/>
|
16
|
+
</g>
|
17
|
+
</g>
|
18
|
+
</g>
|
19
|
+
<g transform="matrix(1,0,0,1,1076.45,0)">
|
20
|
+
<g transform="matrix(0.789583,0,0,0.789583,-233.422,568.437)">
|
21
|
+
<path d="M399.069,182.651L389.349,168.611L388.773,168.611L378.621,168.611L378.621,182.651L366.957,182.651L366.957,132.251L388.773,132.251C393.237,132.251 397.113,132.995 400.401,134.483C403.689,135.971 406.221,138.083 407.997,140.819C409.773,143.555 410.661,146.795 410.661,150.539C410.661,154.283 409.761,157.511 407.961,160.223C406.161,162.935 403.605,165.011 400.293,166.451L411.597,182.651L399.069,182.651ZM398.853,150.539C398.853,147.707 397.941,145.535 396.117,144.023C394.293,142.511 391.629,141.755 388.125,141.755L378.621,141.755L378.621,159.323L388.125,159.323C391.629,159.323 394.293,158.555 396.117,157.019C397.941,155.483 398.853,153.323 398.853,150.539Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
22
|
+
<path d="M453.069,171.851L429.669,171.851L425.205,182.651L413.253,182.651L435.717,132.251L447.237,132.251L469.773,182.651L457.533,182.651L453.069,171.851ZM449.397,162.995L441.405,143.699L433.413,162.995L449.397,162.995Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
23
|
+
<path d="M521.253,132.251L521.253,182.651L511.677,182.651L486.549,152.051L486.549,182.651L475.029,182.651L475.029,132.251L484.677,132.251L509.733,162.851L509.733,132.251L521.253,132.251Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
24
|
+
<path d="M549.765,183.515C545.781,183.515 541.929,182.975 538.209,181.895C534.489,180.815 531.501,179.411 529.245,177.683L533.205,168.899C535.365,170.483 537.933,171.755 540.909,172.715C543.885,173.675 546.861,174.155 549.837,174.155C553.149,174.155 555.597,173.663 557.181,172.679C558.765,171.695 559.557,170.387 559.557,168.755C559.557,167.555 559.089,166.559 558.153,165.767C557.217,164.975 556.017,164.339 554.553,163.859C553.089,163.379 551.109,162.851 548.613,162.275C544.773,161.363 541.629,160.451 539.181,159.539C536.733,158.627 534.633,157.163 532.881,155.147C531.129,153.131 530.253,150.443 530.253,147.083C530.253,144.155 531.045,141.503 532.629,139.127C534.213,136.751 536.601,134.867 539.793,133.475C542.985,132.083 546.885,131.387 551.493,131.387C554.709,131.387 557.853,131.771 560.925,132.539C563.997,133.307 566.685,134.411 568.989,135.851L565.389,144.707C560.733,142.067 556.077,140.747 551.421,140.747C548.157,140.747 545.745,141.275 544.185,142.331C542.625,143.387 541.845,144.779 541.845,146.507C541.845,148.235 542.745,149.519 544.545,150.359C546.345,151.199 549.093,152.027 552.789,152.843C556.629,153.755 559.773,154.667 562.221,155.579C564.669,156.491 566.769,157.931 568.521,159.899C570.273,161.867 571.149,164.531 571.149,167.891C571.149,170.771 570.345,173.399 568.737,175.775C567.129,178.151 564.717,180.035 561.501,181.427C558.285,182.819 554.373,183.515 549.765,183.515Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
25
|
+
<path d="M612.333,171.851L588.933,171.851L584.469,182.651L572.517,182.651L594.981,132.251L606.501,132.251L629.037,182.651L616.797,182.651L612.333,171.851ZM608.661,162.995L600.669,143.699L592.677,162.995L608.661,162.995Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
26
|
+
<path d="M657.693,183.515C652.557,183.515 647.913,182.399 643.761,180.167C639.609,177.935 636.345,174.839 633.969,170.879C631.593,166.919 630.405,162.443 630.405,157.451C630.405,152.459 631.593,147.983 633.969,144.023C636.345,140.063 639.609,136.967 643.761,134.735C647.913,132.503 652.581,131.387 657.765,131.387C662.133,131.387 666.081,132.155 669.609,133.691C673.137,135.227 676.101,137.435 678.501,140.315L671.013,147.227C667.605,143.291 663.381,141.323 658.341,141.323C655.221,141.323 652.437,142.007 649.989,143.375C647.541,144.743 645.633,146.651 644.265,149.099C642.897,151.547 642.213,154.331 642.213,157.451C642.213,160.571 642.897,163.355 644.265,165.803C645.633,168.251 647.541,170.159 649.989,171.527C652.437,172.895 655.221,173.579 658.341,173.579C663.381,173.579 667.605,171.587 671.013,167.603L678.501,174.515C676.101,177.443 673.125,179.675 669.573,181.211C666.021,182.747 662.061,183.515 657.693,183.515Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
27
|
+
<path d="M704.709,162.851L697.941,169.907L697.941,182.651L686.349,182.651L686.349,132.251L697.941,132.251L697.941,155.795L720.261,132.251L733.221,132.251L712.341,154.715L734.445,182.651L720.837,182.651L704.709,162.851Z" style="fill:rgb(5,5,14);fill-rule:nonzero;"/>
|
28
|
+
</g>
|
29
|
+
</g>
|
30
|
+
</g>
|
31
|
+
<defs>
|
32
|
+
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(121.538,125.482,-125.482,121.538,1032.25,1687.61)"><stop offset="0" style="stop-color:rgb(132,132,220);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(51,51,180);stop-opacity:1"/></linearGradient>
|
33
|
+
</defs>
|
34
|
+
</svg>
|
data/logo/ransack.png
ADDED
Binary file
|
data/logo/ransack.svg
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="100%" height="100%" viewBox="0 0 401 417" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
|
4
|
+
<g transform="matrix(1,0,0,1,-199.992,-191.649)">
|
5
|
+
<g transform="matrix(3.50044,0,0,3.50044,-3413.33,-5715.71)">
|
6
|
+
<path d="M1032.25,1689C1032.25,1688.23 1032.87,1687.61 1033.64,1687.61C1042.86,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1141.26,1797.52 1145.72,1805.26C1145.88,1805.54 1145.88,1805.9 1145.72,1806.18C1145.55,1806.47 1145.25,1806.65 1144.91,1806.65C1137.59,1806.65 1107.52,1806.65 1103.12,1806.65C1102.79,1806.65 1102.49,1806.47 1102.32,1806.18C1099.89,1801.97 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1799.1 1073.76,1805.42C1073.76,1806.1 1073.21,1806.65 1072.54,1806.65C1066.45,1806.65 1039.56,1806.65 1033.47,1806.65C1032.8,1806.65 1032.25,1806.1 1032.25,1805.42C1032.25,1793.69 1032.25,1701.48 1032.25,1689Z" style="fill:url(#_Linear1);"/>
|
7
|
+
<clipPath id="_clip2">
|
8
|
+
<path d="M1032.25,1689C1032.25,1688.23 1032.87,1687.61 1033.64,1687.61C1042.86,1687.61 1094.52,1687.61 1094.52,1687.61L1094.52,1687.61C1117.36,1687.65 1135.89,1706.2 1135.89,1729.05C1135.89,1741.48 1128.4,1752.63 1119.73,1760.23C1119.73,1760.23 1141.26,1797.52 1145.72,1805.26C1145.88,1805.54 1145.88,1805.9 1145.72,1806.18C1145.55,1806.47 1145.25,1806.65 1144.91,1806.65C1137.59,1806.65 1107.52,1806.65 1103.12,1806.65C1102.79,1806.65 1102.49,1806.47 1102.32,1806.18C1099.89,1801.97 1081.71,1770.49 1081.71,1770.49L1073.76,1770.49C1073.76,1770.49 1073.76,1799.1 1073.76,1805.42C1073.76,1806.1 1073.21,1806.65 1072.54,1806.65C1066.45,1806.65 1039.56,1806.65 1033.47,1806.65C1032.8,1806.65 1032.25,1806.1 1032.25,1805.42C1032.25,1793.69 1032.25,1701.48 1032.25,1689Z"/>
|
9
|
+
</clipPath>
|
10
|
+
<g clip-path="url(#_clip2)">
|
11
|
+
<g transform="matrix(1.05537,0,0,1.05537,-56.2001,-93.6352)">
|
12
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.29,1771.75 1116.66,1782.78C1117.57,1784.36 1117.57,1786.31 1116.66,1787.89C1115.75,1789.47 1114.06,1790.44 1112.23,1790.44C1112.23,1790.44 1112.23,1790.44 1112.23,1790.44C1110.43,1790.44 1108.76,1789.48 1107.86,1787.92C1103.37,1780.15 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(52,52,107);fill-opacity:0.4;"/>
|
13
|
+
</g>
|
14
|
+
<path d="M1090.07,1757.11C1087.62,1757.78 1085.05,1758.14 1082.39,1758.14C1066.34,1758.14 1053.3,1745.1 1053.3,1729.05C1053.3,1712.99 1066.34,1699.96 1082.39,1699.96C1098.45,1699.96 1111.49,1712.99 1111.49,1729.05C1111.49,1738.8 1106.68,1747.44 1099.3,1752.72C1099.3,1752.72 1110.19,1771.58 1116.57,1782.63C1117.5,1784.24 1117.5,1786.23 1116.57,1787.84C1115.64,1789.45 1113.92,1790.44 1112.06,1790.44C1112.06,1790.44 1112.06,1790.44 1112.06,1790.44C1110.36,1790.44 1108.79,1789.54 1107.94,1788.07C1103.54,1780.44 1090.07,1757.11 1090.07,1757.11ZM1082.52,1708.18C1084.31,1708.32 1084.32,1708.88 1084.66,1709.62C1085.4,1711.22 1084.12,1713.13 1081.99,1713.18C1073.82,1713.44 1066.55,1720.54 1066.53,1729.05C1066.53,1729.05 1066.41,1730.38 1065.53,1731.04C1063.81,1732.34 1061.32,1730.94 1061.59,1727.44C1062.36,1717.22 1071.49,1708.34 1082.13,1708.18C1082.26,1708.18 1082.39,1708.18 1082.52,1708.18Z" style="fill:rgb(251,248,255);"/>
|
15
|
+
</g>
|
16
|
+
</g>
|
17
|
+
</g>
|
18
|
+
<defs>
|
19
|
+
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(121.538,125.482,-125.482,121.538,1032.25,1687.61)"><stop offset="0" style="stop-color:rgb(132,132,220);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(51,51,180);stop-opacity:1"/></linearGradient>
|
20
|
+
</defs>
|
21
|
+
</svg>
|
@@ -584,27 +584,34 @@ module Ransack
|
|
584
584
|
|
585
585
|
context 'case insensitive sorting' do
|
586
586
|
it 'allows sort by desc' do
|
587
|
-
search = Person.
|
587
|
+
search = Person.ransack(sorts: ['name_case_insensitive desc'])
|
588
588
|
expect(search.result.to_sql).to match /ORDER BY LOWER(.*) DESC/
|
589
589
|
end
|
590
590
|
|
591
591
|
it 'allows sort by asc' do
|
592
|
-
search = Person.
|
592
|
+
search = Person.ransack(sorts: ['name_case_insensitive asc'])
|
593
593
|
expect(search.result.to_sql).to match /ORDER BY LOWER(.*) ASC/
|
594
594
|
end
|
595
595
|
end
|
596
596
|
|
597
597
|
context 'regular sorting' do
|
598
598
|
it 'allows sort by desc' do
|
599
|
-
search = Person.
|
599
|
+
search = Person.ransack(sorts: ['name desc'])
|
600
600
|
expect(search.result.to_sql).to match /ORDER BY .* DESC/
|
601
601
|
end
|
602
602
|
|
603
603
|
it 'allows sort by asc' do
|
604
|
-
search = Person.
|
604
|
+
search = Person.ransack(sorts: ['name asc'])
|
605
605
|
expect(search.result.to_sql).to match /ORDER BY .* ASC/
|
606
606
|
end
|
607
607
|
end
|
608
|
+
|
609
|
+
context 'sorting by a scope' do
|
610
|
+
it 'applies the correct scope' do
|
611
|
+
search = Person.ransack(sorts: ['reverse_name asc'])
|
612
|
+
expect(search.result.to_sql).to include("ORDER BY REVERSE(name) ASC")
|
613
|
+
end
|
614
|
+
end
|
608
615
|
end
|
609
616
|
|
610
617
|
describe '#ransackable_attributes' do
|
@@ -25,7 +25,7 @@ module Ransack
|
|
25
25
|
describe '#sort_link with default search_key' do
|
26
26
|
subject { @controller.view_context
|
27
27
|
.sort_link(
|
28
|
-
[:main_app, Person.
|
28
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
29
29
|
:name,
|
30
30
|
controller: 'people'
|
31
31
|
)
|
@@ -38,7 +38,7 @@ module Ransack
|
|
38
38
|
describe '#sort_url with default search_key' do
|
39
39
|
subject { @controller.view_context
|
40
40
|
.sort_url(
|
41
|
-
[:main_app, Person.
|
41
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
42
42
|
:name,
|
43
43
|
controller: 'people'
|
44
44
|
)
|
@@ -49,7 +49,7 @@ module Ransack
|
|
49
49
|
describe '#sort_link with default search_key defined as symbol' do
|
50
50
|
subject { @controller.view_context
|
51
51
|
.sort_link(
|
52
|
-
Person.
|
52
|
+
Person.ransack({ sorts: ['name desc'] }, search_key: :people_search),
|
53
53
|
:name, controller: 'people'
|
54
54
|
)
|
55
55
|
}
|
@@ -59,7 +59,7 @@ module Ransack
|
|
59
59
|
describe '#sort_url with default search_key defined as symbol' do
|
60
60
|
subject { @controller.view_context
|
61
61
|
.sort_url(
|
62
|
-
Person.
|
62
|
+
Person.ransack({ sorts: ['name desc'] }, search_key: :people_search),
|
63
63
|
:name, controller: 'people'
|
64
64
|
)
|
65
65
|
}
|
@@ -69,7 +69,7 @@ module Ransack
|
|
69
69
|
describe '#sort_link desc through association table defined as symbol' do
|
70
70
|
subject { @controller.view_context
|
71
71
|
.sort_link(
|
72
|
-
Person.
|
72
|
+
Person.ransack({ sorts: 'comments_body asc' }),
|
73
73
|
:comments_body,
|
74
74
|
controller: 'people'
|
75
75
|
)
|
@@ -82,7 +82,7 @@ module Ransack
|
|
82
82
|
describe '#sort_url desc through association table defined as symbol' do
|
83
83
|
subject { @controller.view_context
|
84
84
|
.sort_url(
|
85
|
-
Person.
|
85
|
+
Person.ransack({ sorts: 'comments_body asc' }),
|
86
86
|
:comments_body,
|
87
87
|
controller: 'people'
|
88
88
|
)
|
@@ -93,7 +93,7 @@ module Ransack
|
|
93
93
|
describe '#sort_link through association table defined as a string' do
|
94
94
|
subject { @controller.view_context
|
95
95
|
.sort_link(
|
96
|
-
Person.
|
96
|
+
Person.ransack({ sorts: 'comments.body desc' }),
|
97
97
|
'comments.body',
|
98
98
|
controller: 'people'
|
99
99
|
)
|
@@ -106,7 +106,7 @@ module Ransack
|
|
106
106
|
describe '#sort_url through association table defined as a string' do
|
107
107
|
subject { @controller.view_context
|
108
108
|
.sort_url(
|
109
|
-
Person.
|
109
|
+
Person.ransack({ sorts: 'comments.body desc' }),
|
110
110
|
'comments.body',
|
111
111
|
controller: 'people'
|
112
112
|
)
|
@@ -119,7 +119,7 @@ module Ransack
|
|
119
119
|
specify {
|
120
120
|
expect { @controller.view_context
|
121
121
|
.sort_link(
|
122
|
-
Person.
|
122
|
+
Person.ransack(@controller.view_context.params[:q]),
|
123
123
|
:name,
|
124
124
|
controller: 'people'
|
125
125
|
)
|
@@ -132,7 +132,7 @@ module Ransack
|
|
132
132
|
specify {
|
133
133
|
expect { @controller.view_context
|
134
134
|
.sort_url(
|
135
|
-
Person.
|
135
|
+
Person.ransack(@controller.view_context.params[:q]),
|
136
136
|
:name,
|
137
137
|
controller: 'people'
|
138
138
|
)
|
@@ -143,7 +143,7 @@ module Ransack
|
|
143
143
|
describe '#sort_link with search_key defined as a string' do
|
144
144
|
subject { @controller.view_context
|
145
145
|
.sort_link(
|
146
|
-
Person.
|
146
|
+
Person.ransack(
|
147
147
|
{ sorts: ['name desc'] }, search_key: 'people_search'
|
148
148
|
),
|
149
149
|
:name,
|
@@ -156,7 +156,7 @@ module Ransack
|
|
156
156
|
describe '#sort_link with default_order defined with a string key' do
|
157
157
|
subject { @controller.view_context
|
158
158
|
.sort_link(
|
159
|
-
[:main_app, Person.
|
159
|
+
[:main_app, Person.ransack()],
|
160
160
|
:name,
|
161
161
|
controller: 'people',
|
162
162
|
default_order: 'desc'
|
@@ -168,7 +168,7 @@ module Ransack
|
|
168
168
|
describe '#sort_url with default_order defined with a string key' do
|
169
169
|
subject { @controller.view_context
|
170
170
|
.sort_url(
|
171
|
-
[:main_app, Person.
|
171
|
+
[:main_app, Person.ransack()],
|
172
172
|
:name,
|
173
173
|
controller: 'people',
|
174
174
|
default_order: 'desc'
|
@@ -180,7 +180,7 @@ module Ransack
|
|
180
180
|
describe '#sort_link with multiple search_keys defined as an array' do
|
181
181
|
subject { @controller.view_context
|
182
182
|
.sort_link(
|
183
|
-
[:main_app, Person.
|
183
|
+
[:main_app, Person.ransack(sorts: ['name desc', 'email asc'])],
|
184
184
|
:name, [:name, 'email DESC'],
|
185
185
|
controller: 'people'
|
186
186
|
)
|
@@ -196,7 +196,7 @@ module Ransack
|
|
196
196
|
describe '#sort_url with multiple search_keys defined as an array' do
|
197
197
|
subject { @controller.view_context
|
198
198
|
.sort_url(
|
199
|
-
[:main_app, Person.
|
199
|
+
[:main_app, Person.ransack(sorts: ['name desc', 'email asc'])],
|
200
200
|
:name, [:name, 'email DESC'],
|
201
201
|
controller: 'people'
|
202
202
|
)
|
@@ -210,7 +210,7 @@ module Ransack
|
|
210
210
|
describe '#sort_link with multiple search_keys does not break on nil values & ignores them' do
|
211
211
|
subject { @controller.view_context
|
212
212
|
.sort_link(
|
213
|
-
[:main_app, Person.
|
213
|
+
[:main_app, Person.ransack(sorts: ['name desc', nil, 'email', nil])],
|
214
214
|
:name, [nil, :name, nil, 'email DESC', nil],
|
215
215
|
controller: 'people'
|
216
216
|
)
|
@@ -226,7 +226,7 @@ module Ransack
|
|
226
226
|
describe '#sort_url with multiple search_keys does not break on nil values & ignores them' do
|
227
227
|
subject { @controller.view_context
|
228
228
|
.sort_url(
|
229
|
-
[:main_app, Person.
|
229
|
+
[:main_app, Person.ransack(sorts: ['name desc', nil, 'email', nil])],
|
230
230
|
:name, [nil, :name, nil, 'email DESC', nil],
|
231
231
|
controller: 'people'
|
232
232
|
)
|
@@ -240,7 +240,7 @@ module Ransack
|
|
240
240
|
describe '#sort_link with multiple search_keys should allow a label to be specified' do
|
241
241
|
subject { @controller.view_context
|
242
242
|
.sort_link(
|
243
|
-
[:main_app, Person.
|
243
|
+
[:main_app, Person.ransack(sorts: ['name desc', 'email asc'])],
|
244
244
|
:name, [:name, 'email DESC'],
|
245
245
|
'Property Name',
|
246
246
|
controller: 'people'
|
@@ -252,7 +252,7 @@ module Ransack
|
|
252
252
|
describe '#sort_link with multiple search_keys should flip multiple fields specified without a direction' do
|
253
253
|
subject { @controller.view_context
|
254
254
|
.sort_link(
|
255
|
-
[:main_app, Person.
|
255
|
+
[:main_app, Person.ransack(sorts: ['name desc', 'email asc'])],
|
256
256
|
:name, [:name, :email],
|
257
257
|
controller: 'people'
|
258
258
|
)
|
@@ -268,7 +268,7 @@ module Ransack
|
|
268
268
|
describe '#sort_url with multiple search_keys should flip multiple fields specified without a direction' do
|
269
269
|
subject { @controller.view_context
|
270
270
|
.sort_url(
|
271
|
-
[:main_app, Person.
|
271
|
+
[:main_app, Person.ransack(sorts: ['name desc', 'email asc'])],
|
272
272
|
:name, [:name, :email],
|
273
273
|
controller: 'people'
|
274
274
|
)
|
@@ -282,7 +282,7 @@ module Ransack
|
|
282
282
|
describe '#sort_link with multiple search_keys and default_order specified as a string' do
|
283
283
|
subject { @controller.view_context
|
284
284
|
.sort_link(
|
285
|
-
[:main_app, Person.
|
285
|
+
[:main_app, Person.ransack()],
|
286
286
|
:name, [:name, :email],
|
287
287
|
controller: 'people',
|
288
288
|
default_order: 'desc'
|
@@ -299,7 +299,7 @@ module Ransack
|
|
299
299
|
describe '#sort_url with multiple search_keys and default_order specified as a string' do
|
300
300
|
subject { @controller.view_context
|
301
301
|
.sort_url(
|
302
|
-
[:main_app, Person.
|
302
|
+
[:main_app, Person.ransack()],
|
303
303
|
:name, [:name, :email],
|
304
304
|
controller: 'people',
|
305
305
|
default_order: 'desc'
|
@@ -314,7 +314,7 @@ module Ransack
|
|
314
314
|
describe '#sort_link with multiple search_keys and default_order specified as a symbol' do
|
315
315
|
subject { @controller.view_context
|
316
316
|
.sort_link(
|
317
|
-
[:main_app, Person.
|
317
|
+
[:main_app, Person.ransack()],
|
318
318
|
:name, [:name, :email],
|
319
319
|
controller: 'people',
|
320
320
|
default_order: :desc
|
@@ -331,7 +331,7 @@ module Ransack
|
|
331
331
|
describe '#sort_url with multiple search_keys and default_order specified as a symbol' do
|
332
332
|
subject { @controller.view_context
|
333
333
|
.sort_url(
|
334
|
-
[:main_app, Person.
|
334
|
+
[:main_app, Person.ransack],
|
335
335
|
:name, [:name, :email],
|
336
336
|
controller: 'people',
|
337
337
|
default_order: :desc
|
@@ -346,7 +346,7 @@ module Ransack
|
|
346
346
|
describe '#sort_link with multiple search_keys should allow multiple default_orders to be specified' do
|
347
347
|
subject { @controller.view_context
|
348
348
|
.sort_link(
|
349
|
-
[:main_app, Person.
|
349
|
+
[:main_app, Person.ransack],
|
350
350
|
:name, [:name, :email],
|
351
351
|
controller: 'people',
|
352
352
|
default_order: { name: 'desc', email: 'asc' }
|
@@ -363,7 +363,7 @@ module Ransack
|
|
363
363
|
describe '#sort_url with multiple search_keys should allow multiple default_orders to be specified' do
|
364
364
|
subject { @controller.view_context
|
365
365
|
.sort_url(
|
366
|
-
[:main_app, Person.
|
366
|
+
[:main_app, Person.ransack],
|
367
367
|
:name, [:name, :email],
|
368
368
|
controller: 'people',
|
369
369
|
default_order: { name: 'desc', email: 'asc' }
|
@@ -378,7 +378,7 @@ module Ransack
|
|
378
378
|
describe '#sort_link with multiple search_keys with multiple default_orders should not override a specified order' do
|
379
379
|
subject { @controller.view_context
|
380
380
|
.sort_link(
|
381
|
-
[:main_app, Person.
|
381
|
+
[:main_app, Person.ransack],
|
382
382
|
:name, [:name, 'email desc'],
|
383
383
|
controller: 'people',
|
384
384
|
default_order: { name: 'desc', email: 'asc' }
|
@@ -395,7 +395,7 @@ module Ransack
|
|
395
395
|
describe '#sort_url with multiple search_keys with multiple default_orders should not override a specified order' do
|
396
396
|
subject { @controller.view_context
|
397
397
|
.sort_url(
|
398
|
-
[:main_app, Person.
|
398
|
+
[:main_app, Person.ransack],
|
399
399
|
:name, [:name, 'email desc'],
|
400
400
|
controller: 'people',
|
401
401
|
default_order: { name: 'desc', email: 'asc' }
|
@@ -410,7 +410,7 @@ module Ransack
|
|
410
410
|
describe "#sort_link on polymorphic association should preserve association model name case" do
|
411
411
|
subject { @controller.view_context
|
412
412
|
.sort_link(
|
413
|
-
[:main_app, Note.
|
413
|
+
[:main_app, Note.ransack],
|
414
414
|
:notable_of_Person_type_name, "Notable",
|
415
415
|
controller: 'notes'
|
416
416
|
)
|
@@ -423,7 +423,7 @@ module Ransack
|
|
423
423
|
describe "#sort_url on polymorphic association should preserve association model name case" do
|
424
424
|
subject { @controller.view_context
|
425
425
|
.sort_link(
|
426
|
-
[:main_app, Note.
|
426
|
+
[:main_app, Note.ransack],
|
427
427
|
:notable_of_Person_type_name, "Notable",
|
428
428
|
controller: 'notes'
|
429
429
|
)
|
@@ -439,7 +439,7 @@ module Ransack
|
|
439
439
|
|
440
440
|
subject {
|
441
441
|
@controller.view_context.sort_link(
|
442
|
-
Person.
|
442
|
+
Person.ransack(
|
443
443
|
{ sorts: ['name desc'] },
|
444
444
|
search_key: 'people_search'
|
445
445
|
),
|
@@ -457,7 +457,7 @@ module Ransack
|
|
457
457
|
|
458
458
|
subject {
|
459
459
|
@controller.view_context.sort_url(
|
460
|
-
Person.
|
460
|
+
Person.ransack(
|
461
461
|
{ sorts: ['name desc'] },
|
462
462
|
search_key: 'people_search'
|
463
463
|
),
|
@@ -473,7 +473,7 @@ module Ransack
|
|
473
473
|
if: ::ActiveRecord::VERSION::MAJOR > 3 do
|
474
474
|
|
475
475
|
describe 'with symbol q:, #sort_link should include search params' do
|
476
|
-
subject { @controller.view_context.sort_link(Person.
|
476
|
+
subject { @controller.view_context.sort_link(Person.ransack, :name) }
|
477
477
|
let(:params) { ActionController::Parameters.new(
|
478
478
|
{ :q => { name_eq: 'TEST' }, controller: 'people' }
|
479
479
|
) }
|
@@ -488,7 +488,7 @@ module Ransack
|
|
488
488
|
end
|
489
489
|
|
490
490
|
describe 'with symbol q:, #sort_url should include search params' do
|
491
|
-
subject { @controller.view_context.sort_url(Person.
|
491
|
+
subject { @controller.view_context.sort_url(Person.ransack, :name) }
|
492
492
|
let(:params) { ActionController::Parameters.new(
|
493
493
|
{ :q => { name_eq: 'TEST' }, controller: 'people' }
|
494
494
|
) }
|
@@ -503,7 +503,7 @@ module Ransack
|
|
503
503
|
end
|
504
504
|
|
505
505
|
describe "with string 'q', #sort_link should include search params" do
|
506
|
-
subject { @controller.view_context.sort_link(Person.
|
506
|
+
subject { @controller.view_context.sort_link(Person.ransack, :name) }
|
507
507
|
let(:params) {
|
508
508
|
ActionController::Parameters.new(
|
509
509
|
{ 'q' => { name_eq: 'Test2' }, controller: 'people' }
|
@@ -519,7 +519,7 @@ module Ransack
|
|
519
519
|
end
|
520
520
|
|
521
521
|
describe "with string 'q', #sort_url should include search params" do
|
522
|
-
subject { @controller.view_context.sort_url(Person.
|
522
|
+
subject { @controller.view_context.sort_url(Person.ransack, :name) }
|
523
523
|
let(:params) {
|
524
524
|
ActionController::Parameters.new(
|
525
525
|
{ 'q' => { name_eq: 'Test2' }, controller: 'people' }
|
@@ -539,7 +539,7 @@ module Ransack
|
|
539
539
|
describe '#sort_link with hide order indicator set to true' do
|
540
540
|
subject { @controller.view_context
|
541
541
|
.sort_link(
|
542
|
-
[:main_app, Person.
|
542
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
543
543
|
:name,
|
544
544
|
controller: 'people',
|
545
545
|
hide_indicator: true
|
@@ -552,7 +552,7 @@ module Ransack
|
|
552
552
|
describe '#sort_link with hide order indicator set to false' do
|
553
553
|
subject { @controller.view_context
|
554
554
|
.sort_link(
|
555
|
-
[:main_app, Person.
|
555
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
556
556
|
:name,
|
557
557
|
controller: 'people',
|
558
558
|
hide_indicator: false
|
@@ -572,7 +572,7 @@ module Ransack
|
|
572
572
|
|
573
573
|
subject { @controller.view_context
|
574
574
|
.sort_link(
|
575
|
-
[:main_app, Person.
|
575
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
576
576
|
:name,
|
577
577
|
controller: 'people',
|
578
578
|
hide_indicator: false
|
@@ -593,7 +593,7 @@ module Ransack
|
|
593
593
|
|
594
594
|
subject { @controller.view_context
|
595
595
|
.sort_link(
|
596
|
-
[:main_app, Person.
|
596
|
+
[:main_app, Person.ransack(sorts: ['name asc'])],
|
597
597
|
:name,
|
598
598
|
controller: 'people',
|
599
599
|
hide_indicator: false
|
@@ -614,7 +614,7 @@ module Ransack
|
|
614
614
|
|
615
615
|
subject { @controller.view_context
|
616
616
|
.sort_link(
|
617
|
-
[:main_app, Person.
|
617
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
618
618
|
:name,
|
619
619
|
controller: 'people'
|
620
620
|
)
|
@@ -630,7 +630,7 @@ module Ransack
|
|
630
630
|
|
631
631
|
subject { @controller.view_context
|
632
632
|
.sort_link(
|
633
|
-
[:main_app, Person.
|
633
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
634
634
|
:name,
|
635
635
|
controller: 'people'
|
636
636
|
)
|
@@ -655,7 +655,7 @@ module Ransack
|
|
655
655
|
|
656
656
|
subject { @controller.view_context
|
657
657
|
.sort_link(
|
658
|
-
[:main_app, Person.
|
658
|
+
[:main_app, Person.ransack],
|
659
659
|
:name,
|
660
660
|
controller: 'people'
|
661
661
|
)
|
@@ -681,7 +681,7 @@ module Ransack
|
|
681
681
|
|
682
682
|
subject { @controller.view_context
|
683
683
|
.sort_link(
|
684
|
-
[:main_app, Person.
|
684
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
685
685
|
:name,
|
686
686
|
controller: 'people'
|
687
687
|
)
|
@@ -707,7 +707,7 @@ module Ransack
|
|
707
707
|
|
708
708
|
subject { @controller.view_context
|
709
709
|
.sort_link(
|
710
|
-
[:main_app, Person.
|
710
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
711
711
|
:name,
|
712
712
|
controller: 'people'
|
713
713
|
)
|
@@ -719,7 +719,7 @@ module Ransack
|
|
719
719
|
describe '#sort_link with a block' do
|
720
720
|
subject { @controller.view_context
|
721
721
|
.sort_link(
|
722
|
-
[:main_app, Person.
|
722
|
+
[:main_app, Person.ransack(sorts: ['name desc'])],
|
723
723
|
:name,
|
724
724
|
controller: 'people'
|
725
725
|
) { 'Block label' }
|
@@ -729,14 +729,14 @@ module Ransack
|
|
729
729
|
|
730
730
|
describe '#search_form_for with default format' do
|
731
731
|
subject { @controller.view_context
|
732
|
-
.search_form_for(Person.
|
732
|
+
.search_form_for(Person.ransack) {} }
|
733
733
|
it { should match /action="\/people"/ }
|
734
734
|
end
|
735
735
|
|
736
736
|
describe '#search_form_for with pdf format' do
|
737
737
|
subject {
|
738
738
|
@controller.view_context
|
739
|
-
.search_form_for(Person.
|
739
|
+
.search_form_for(Person.ransack, format: :pdf) {}
|
740
740
|
}
|
741
741
|
it { should match /action="\/people.pdf"/ }
|
742
742
|
end
|
@@ -744,7 +744,7 @@ module Ransack
|
|
744
744
|
describe '#search_form_for with json format' do
|
745
745
|
subject {
|
746
746
|
@controller.view_context
|
747
|
-
.search_form_for(Person.
|
747
|
+
.search_form_for(Person.ransack, format: :json) {}
|
748
748
|
}
|
749
749
|
it { should match /action="\/people.json"/ }
|
750
750
|
end
|
@@ -752,7 +752,7 @@ module Ransack
|
|
752
752
|
describe '#search_form_for with an array of routes' do
|
753
753
|
subject {
|
754
754
|
@controller.view_context
|
755
|
-
.search_form_for([:admin, Comment.
|
755
|
+
.search_form_for([:admin, Comment.ransack]) {}
|
756
756
|
}
|
757
757
|
it { should match /action="\/admin\/comments"/ }
|
758
758
|
end
|
@@ -763,7 +763,7 @@ module Ransack
|
|
763
763
|
end
|
764
764
|
subject {
|
765
765
|
@controller.view_context
|
766
|
-
.search_form_for(Person.
|
766
|
+
.search_form_for(Person.ransack) { |f| f.text_field :name_eq }
|
767
767
|
}
|
768
768
|
it { should match /example_name_eq/ }
|
769
769
|
end
|