motor-admin 0.4.5 → 0.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/motor/load_and_authorize_dynamic_resource.rb +4 -1
- data/app/models/motor/query.rb +2 -0
- data/config/locales/el.yml +0 -3
- data/config/locales/en.yml +0 -9
- data/config/locales/es.yml +0 -9
- data/config/locales/pt.yml +0 -9
- data/lib/motor/admin.rb +11 -5
- data/lib/motor/api_query/search.rb +3 -1
- data/lib/motor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f591c0e7f8d6230fb49aa0ca7ae5a2f960f2d5a117182d8123e7f86e9e1f102
|
4
|
+
data.tar.gz: 8181680a758dc7d7e150036979e22c64df911fd528985b4858a93b86e6f051bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1659c1b5df414a6b6a0f28a18a734caf8cc0302023f82885c5b8ed0e844e46420512bac822a7baa73efb13b823d9aec29a2261a084191d0aaa67d9172c5e9cb1
|
7
|
+
data.tar.gz: 7bb52dad21ef7d941aa8a366ceee190e4ae463cd465fe8a4789e37dea046e30dc88efe9ade3e1f2e5228e523465262ebdfaea6732053af45e01a4f931ca877a6
|
@@ -4,6 +4,8 @@ module Motor
|
|
4
4
|
module LoadAndAuthorizeDynamicResource
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
+
MUTEX = Mutex.new
|
8
|
+
|
7
9
|
INSTANCE_VARIABLE_NAME = 'resource'
|
8
10
|
ASSOCIATION_INSTANCE_VARIABLE_NAME = 'associated_resource'
|
9
11
|
|
@@ -13,11 +15,12 @@ module Motor
|
|
13
15
|
end
|
14
16
|
|
15
17
|
def resource_class
|
16
|
-
@resource_class ||=
|
18
|
+
@resource_class ||= MUTEX.synchronize do
|
17
19
|
Motor::Resources::FetchConfiguredModel.call(
|
18
20
|
Motor::BuildSchema::Utils.classify_slug(resource_name_prefix + params[:resource]),
|
19
21
|
cache_key: Motor::Resource.maximum(:updated_at)
|
20
22
|
)
|
23
|
+
end
|
21
24
|
end
|
22
25
|
|
23
26
|
def resource_name_prefix
|
data/app/models/motor/query.rb
CHANGED
data/config/locales/el.yml
CHANGED
@@ -29,7 +29,6 @@ el:
|
|
29
29
|
all: Όλα
|
30
30
|
all_resources: Όλοι οι πόροι
|
31
31
|
and: Και
|
32
|
-
api: API
|
33
32
|
api_path: Διαδρομή API
|
34
33
|
api_request: Αίτημα API
|
35
34
|
apply: Εφαρμογή
|
@@ -317,8 +316,6 @@ el:
|
|
317
316
|
updated: ενημερωμένο
|
318
317
|
created: δημιουργήθηκε
|
319
318
|
deleted: διαγράφηκε
|
320
|
-
sign_out: Αποσυνδεθείτε
|
321
|
-
user_dropdown: Χρήστης dropdown
|
322
319
|
add_condition: Προσθήκη συνθήκης
|
323
320
|
remove_condition: Αφαίρεση συνθήκης
|
324
321
|
unable_to_send_alert: Αδυναμία αποστολής ειδοποίησης
|
data/config/locales/en.yml
CHANGED
@@ -29,7 +29,6 @@ en:
|
|
29
29
|
all: All
|
30
30
|
all_resources: All Resources
|
31
31
|
and: And
|
32
|
-
api: API
|
33
32
|
api_path: API path
|
34
33
|
api_request: API request
|
35
34
|
apply: Apply
|
@@ -266,14 +265,6 @@ en:
|
|
266
265
|
video: Video
|
267
266
|
display_column: Display column
|
268
267
|
not_authorized_to_perform_action: You are not authorized to perform this action.
|
269
|
-
download: Download
|
270
|
-
alert: Alert
|
271
|
-
downloading: Downloading
|
272
|
-
display_id: Display ID
|
273
|
-
display_settings: Display settings
|
274
|
-
sign_out: Sign out
|
275
|
-
header: Header
|
276
|
-
user_dropdown: User dropdown
|
277
268
|
upload: Upload
|
278
269
|
there_is_nothing_here_yet: There is nothing here yet 🤷♂️
|
279
270
|
is_null: Is null
|
data/config/locales/es.yml
CHANGED
@@ -315,20 +315,11 @@ es:
|
|
315
315
|
updated: updated
|
316
316
|
created: created
|
317
317
|
deleted: deleted
|
318
|
-
sign_out: Sign out
|
319
|
-
header: Header
|
320
|
-
user_dropdown: User dropdown
|
321
318
|
add_condition: Add Condition
|
322
319
|
remove_condition: Remove Condition
|
323
320
|
unable_to_send_alert: Unable to send alert
|
324
321
|
send_via: Send via
|
325
|
-
download: Descargar
|
326
|
-
alert: Alerta
|
327
|
-
downloading: Descargando
|
328
|
-
display_id: Visualizar ID
|
329
|
-
display_settings: Configuración de la pantalla
|
330
322
|
sql: SQL
|
331
|
-
api: API
|
332
323
|
variable_name: Nombre de la variable
|
333
324
|
add_variable: Añadir variable
|
334
325
|
notes: Notes
|
data/config/locales/pt.yml
CHANGED
@@ -311,20 +311,11 @@ pt:
|
|
311
311
|
updated: updated
|
312
312
|
created: created
|
313
313
|
deleted: deleted
|
314
|
-
sign_out: Sign out
|
315
|
-
header: Header
|
316
|
-
user_dropdown: User dropdown
|
317
314
|
add_condition: Add Condition
|
318
315
|
remove_condition: Remove Condition
|
319
316
|
unable_to_send_alert: Unable to send alert
|
320
317
|
send_via: Send via
|
321
|
-
download: Descarregar
|
322
|
-
alert: Alerta
|
323
|
-
downloading: Descarregamento
|
324
|
-
display_id: Mostrar ID
|
325
|
-
display_settings: Definições de visualização
|
326
318
|
sql: SQL
|
327
|
-
api: API
|
328
319
|
variable_name: Nome da variável
|
329
320
|
add_variable: Adicionar variável
|
330
321
|
notes: Notes
|
data/lib/motor/admin.rb
CHANGED
@@ -4,6 +4,16 @@ module Motor
|
|
4
4
|
class Admin < ::Rails::Engine
|
5
5
|
config.custom_html = ''
|
6
6
|
|
7
|
+
if !Motor.development? && !Rails.env.production?
|
8
|
+
config.eager_load_paths.delete(File.expand_path('../../app/controllers', __dir__))
|
9
|
+
config.eager_load_paths.delete(File.expand_path('../../app/controllers/concerns', __dir__))
|
10
|
+
config.eager_load_paths.delete(File.expand_path('../../app/models', __dir__))
|
11
|
+
|
12
|
+
config.autoload_once_paths << File.expand_path('../../app/models', __dir__)
|
13
|
+
config.autoload_once_paths << File.expand_path('../../app/controllers', __dir__)
|
14
|
+
config.autoload_once_paths << File.expand_path('../../app/controllers/concerns', __dir__)
|
15
|
+
end
|
16
|
+
|
7
17
|
initializer 'motor.startup_message' do
|
8
18
|
config.after_initialize do
|
9
19
|
next unless Motor.server?
|
@@ -108,15 +118,13 @@ module Motor
|
|
108
118
|
end
|
109
119
|
|
110
120
|
initializer 'motor.upgrade' do
|
111
|
-
|
121
|
+
ActiveSupport.on_load(:motor_query) do
|
112
122
|
next unless Motor.server?
|
113
123
|
|
114
124
|
unless Motor::Query.table_exists?
|
115
125
|
puts
|
116
126
|
puts ' => Run `rails g motor:install && rake db:migrate` in order to create Motor Admin configuration tables'
|
117
127
|
puts
|
118
|
-
|
119
|
-
raise
|
120
128
|
end
|
121
129
|
|
122
130
|
if !Motor::ApiConfig.table_exists? || !Motor::Note.table_exists?
|
@@ -124,8 +132,6 @@ module Motor
|
|
124
132
|
puts ' => Run `rails g motor:upgrade && rake db:migrate` ' \
|
125
133
|
'to perform data migration and enable the latest features'
|
126
134
|
puts
|
127
|
-
|
128
|
-
raise
|
129
135
|
end
|
130
136
|
end
|
131
137
|
end
|
@@ -30,7 +30,9 @@ module Motor
|
|
30
30
|
arel_table = model.arel_table
|
31
31
|
|
32
32
|
column_names.map do |name|
|
33
|
-
column_type = model.columns_hash[name]
|
33
|
+
column_type = model.columns_hash[name]&.type
|
34
|
+
|
35
|
+
next unless column_type
|
34
36
|
|
35
37
|
if STRING_COLUMN_TYPES.include?(column_type)
|
36
38
|
arel_table[name].matches("%#{keyword}%")
|
data/lib/motor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motor-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Matsyburka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ar_lazy_preload
|