motor-admin 0.3.5 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/motor/active_record_utils/active_record_filter.rb +60 -60
- data/lib/motor/version.rb +1 -1
- data/lib/motor.rb +0 -1
- data/ui/dist/{main-53a1a9dffc796b4ca695.css.gz → main-51ca7a4e6d0745da1aa5.css.gz} +0 -0
- data/ui/dist/main-51ca7a4e6d0745da1aa5.js.gz +0 -0
- data/ui/dist/manifest.json +5 -5
- metadata +6 -20
- data/ui/dist/main-53a1a9dffc796b4ca695.js.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ff52913a60cfabf145dad356facf20ddcd67a5d34d301805b00f035892f004f
|
4
|
+
data.tar.gz: 578f5f5f276856d55b9011347c5e6fe3277f8aac7827a5e919d7d87ecc6e23f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3611e7b266ee6c5f69543e6de1ea6ca9ed6aa420d7f355d3289a7cbf52c2568aec5941b98043dbc9d1ae7ce12aced943aca8bc04a95c6e67950879622ec83ff
|
7
|
+
data.tar.gz: b77573c1149ca48d113640a31ecfb979f46e71ae5625e2f584c2a6a2c31197d81be3a7cc73136a558903c043adca3a2f2f9d990db0fe69fd7fb130c289c70aa3
|
@@ -5,14 +5,44 @@ module ActiveRecord
|
|
5
5
|
end
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
module Arel
|
9
|
+
module Attributes
|
10
|
+
class Relation < Attribute
|
11
|
+
attr_accessor :collection, :for_write
|
12
|
+
|
13
|
+
def initialize(relation, name, collection = false, for_write = false)
|
14
|
+
self[:relation] = relation
|
15
|
+
self[:name] = name
|
16
|
+
@collection = collection
|
17
|
+
@for_write = for_write
|
18
|
+
end
|
19
|
+
|
20
|
+
delegate :able_to_type_cast?, to: :relation
|
21
|
+
|
22
|
+
def table_name
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def eql?(other)
|
27
|
+
self.class == other.class &&
|
28
|
+
relation == other.relation &&
|
29
|
+
name == other.name &&
|
30
|
+
collection == other.collection
|
31
|
+
end
|
32
|
+
|
33
|
+
delegate :type_cast_for_database, to: :relation
|
34
|
+
end
|
13
35
|
end
|
36
|
+
end
|
14
37
|
|
15
|
-
|
38
|
+
module Arel
|
39
|
+
module Visitors
|
40
|
+
class ToSql
|
41
|
+
def visit_Arel_Attributes_Relation(o, collector)
|
42
|
+
visit(o.relation, collector)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
16
46
|
end
|
17
47
|
|
18
48
|
module ActiveRecord
|
@@ -64,29 +94,30 @@ module ActiveRecord
|
|
64
94
|
end
|
65
95
|
elsif reflection = klass._reflections[key.to_s]
|
66
96
|
if value.is_a?(Hash)
|
67
|
-
relations <<
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
97
|
+
relations <<
|
98
|
+
if reflection.polymorphic?
|
99
|
+
value = value.dup
|
100
|
+
join_klass = value.delete(:as).safe_constantize
|
101
|
+
right_table = join_klass.arel_table
|
102
|
+
left_table = reflection.active_record.arel_table
|
103
|
+
|
104
|
+
on = right_table[join_klass.primary_key]
|
105
|
+
.eq(left_table[reflection.foreign_key])
|
106
|
+
.and(left_table[reflection.foreign_type].eq(join_klass.name))
|
107
|
+
|
108
|
+
cross_boundry_joins = join_klass.left_outer_joins(ActiveRecord::PredicateBuilder.filter_joins(join_klass, value).flatten).send(
|
109
|
+
:build_joins, []
|
110
|
+
)
|
111
|
+
|
112
|
+
[
|
113
|
+
left_table.join(right_table, Arel::Nodes::OuterJoin).on(on).join_sources,
|
114
|
+
cross_boundry_joins
|
115
|
+
]
|
116
|
+
else
|
117
|
+
{
|
118
|
+
key => build_filter_joins(reflection.klass, value, [], custom)
|
119
|
+
}
|
120
|
+
end
|
90
121
|
elsif value.is_a?(Array)
|
91
122
|
value.each do |v|
|
92
123
|
relations << {
|
@@ -233,37 +264,6 @@ module ActiveRecord
|
|
233
264
|
attribute.has_any_key(*Array(value).map { |x| Arel::Nodes.build_quoted(x) })
|
234
265
|
when :in
|
235
266
|
attribute.in(value)
|
236
|
-
when :intersects
|
237
|
-
# geometry_value = if value.is_a?(Hash) # GeoJSON
|
238
|
-
# Arel::Nodes::NamedFunction.new('ST_GeomFromGeoJSON', [JSON.generate(value)])
|
239
|
-
# elsif # EWKB
|
240
|
-
# elsif # WKB
|
241
|
-
# elsif # EWKT
|
242
|
-
# elsif # WKT
|
243
|
-
# end
|
244
|
-
|
245
|
-
# TODO: us above if to determin if SRID sent
|
246
|
-
geometry_value = if value.is_a?(Hash)
|
247
|
-
Arel::Nodes::NamedFunction.new('ST_SetSRID',
|
248
|
-
[
|
249
|
-
Arel::Nodes::NamedFunction.new('ST_GeomFromGeoJSON',
|
250
|
-
[Arel::Nodes.build_quoted(JSON.generate(subvalue))]), 4326
|
251
|
-
])
|
252
|
-
elsif value[0, 1] == "\x00" || value[0, 1] == "\x01" || value[0, 4] =~ /[0-9a-fA-F]{4}/
|
253
|
-
Arel::Nodes::NamedFunction.new('ST_SetSRID',
|
254
|
-
[
|
255
|
-
Arel::Nodes::NamedFunction.new('ST_GeomFromEWKB',
|
256
|
-
[Arel::Nodes.build_quoted(subvalue)]), 4326
|
257
|
-
])
|
258
|
-
else
|
259
|
-
Arel::Nodes::NamedFunction.new('ST_SetSRID',
|
260
|
-
[
|
261
|
-
Arel::Nodes::NamedFunction.new('ST_GeomFromText',
|
262
|
-
[Arel::Nodes.build_quoted(subvalue)]), 4326
|
263
|
-
])
|
264
|
-
end
|
265
|
-
|
266
|
-
Arel::Nodes::NamedFunction.new('ST_Intersects', [attribute, geometry_value])
|
267
267
|
when :less_than, :lt
|
268
268
|
attribute.lt(value)
|
269
269
|
when :less_than_or_equal_to, :lteq, :lte
|
data/lib/motor/version.rb
CHANGED
data/lib/motor.rb
CHANGED
File without changes
|
Binary file
|
data/ui/dist/manifest.json
CHANGED
@@ -3966,9 +3966,9 @@
|
|
3966
3966
|
"images/marker-icon-2x.png": "images/marker-icon-2x.png",
|
3967
3967
|
"images/marker-icon.png": "images/marker-icon.png",
|
3968
3968
|
"images/marker-shadow.png": "images/marker-shadow.png",
|
3969
|
-
"main-
|
3970
|
-
"main-
|
3971
|
-
"main-
|
3972
|
-
"main.css": "main-
|
3973
|
-
"main.js": "main-
|
3969
|
+
"main-51ca7a4e6d0745da1aa5.css.gz": "main-51ca7a4e6d0745da1aa5.css.gz",
|
3970
|
+
"main-51ca7a4e6d0745da1aa5.js.LICENSE.txt": "main-51ca7a4e6d0745da1aa5.js.LICENSE.txt",
|
3971
|
+
"main-51ca7a4e6d0745da1aa5.js.gz": "main-51ca7a4e6d0745da1aa5.js.gz",
|
3972
|
+
"main.css": "main-51ca7a4e6d0745da1aa5.css",
|
3973
|
+
"main.js": "main-51ca7a4e6d0745da1aa5.js"
|
3974
3974
|
}
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: arel-extensions
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '6.0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '6.0'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: ar_lazy_preload
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +72,14 @@ dependencies:
|
|
86
72
|
requirements:
|
87
73
|
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
75
|
+
version: '5.2'
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '5.2'
|
97
83
|
description: |
|
98
84
|
Motor Admin allows to create a flexible admin panel with writing less code.
|
99
85
|
All customizations to the admin panel can be made directly in the UI without
|
@@ -2219,8 +2205,8 @@ files:
|
|
2219
2205
|
- ui/dist/images/marker-icon-2x.png
|
2220
2206
|
- ui/dist/images/marker-icon.png
|
2221
2207
|
- ui/dist/images/marker-shadow.png
|
2222
|
-
- ui/dist/main-
|
2223
|
-
- ui/dist/main-
|
2208
|
+
- ui/dist/main-51ca7a4e6d0745da1aa5.css.gz
|
2209
|
+
- ui/dist/main-51ca7a4e6d0745da1aa5.js.gz
|
2224
2210
|
- ui/dist/manifest.json
|
2225
2211
|
homepage:
|
2226
2212
|
licenses:
|
Binary file
|