motor-admin 0.3.0 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a15345e4f0be22dda572c79266ae05e856362e2725850cd15e94689b2ce47f8
4
- data.tar.gz: 523971a3051bc7fb09597187cc30cd1c643ae64307208d8391ea33915c858745
3
+ metadata.gz: a2381b665cf63ac72903b322e652a119c154215db95b477e4f723eb4c0bbdf97
4
+ data.tar.gz: 44ffba20a1acb4206a43abfba8ab58c36cb7fd5ff421926c06347f2df3e7a168
5
5
  SHA512:
6
- metadata.gz: a1e695cbcba7f1d0b3d5eac466b3b3c56f2a69ee4a1a1cf0f0f335fa7db5bf3ee16c4e9a7db4e3914fa90a65c16bd2951914f1d9e1f6aa777f869d5864495f82
7
- data.tar.gz: 22e36131c24fbd2a97cc7650a10a7158546a857b6b2ecfcf391c471176e5d827d23469815ae65ebdfe58cbfe02cafa7b26122b69176c889e9e6115fcdf49ca16
6
+ metadata.gz: 3f9c1360a6d42da64df2bfeed16d2765aef367ec535d3469d91b3093e3f12ab640fd72c13f76bc8e26dbccad1813c7583c7fce9d81dd8c725c79cbde92d6df97
7
+ data.tar.gz: 17daf2ac024c72d6614ea8fa21814c7f224d325f6f8872d1e8df4bbc54bdfe1019622e6c4570821bb17588645010c3b1e126e4865ca056ba62c492294f3e6202
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  <div align="center">
2
2
 
3
- [![Motor Admin](https://user-images.githubusercontent.com/5418788/140520844-a947845d-b579-4b3f-9b49-c539ad3cf580.png)](https://www.getmotoradmin.com)
3
+ [![Motor Admin Rails](https://user-images.githubusercontent.com/5418788/140520844-a947845d-b579-4b3f-9b49-c539ad3cf580.png)](https://www.getmotoradmin.com/ruby-on-rails)
4
4
 
5
- # Motor Admin
5
+ # Motor Admin Rails
6
6
 
7
7
  Low-code Admin panel and Business intelligence Rails engine **(no DSL - configurable from the UI)**.
8
8
 
9
- 🤓 [Demo App](https://motor-admin.herokuapp.com/demo) | 👀 [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | ⭐ [Pro](https://www.getmotoradmin.com/rails)
9
+ 🤓 [Demo App](https://motor-admin.herokuapp.com/demo) | 👀 [Features overview](https://www.youtube.com/watch?v=ngVoci8Hll4&list=PLu7llEMh0KcOkR3Uy_RJT0cXPZQKAYVsq&index=1) | ⭐ [Pro](https://www.getmotoradmin.com/ruby-on-rails)
10
10
  </div>
11
11
 
12
12
  [![Admin Panel](https://user-images.githubusercontent.com/5418788/119318538-1f30e300-bc82-11eb-94a4-107c31c93b13.png)](https://motor-admin.herokuapp.com/demo)
@@ -45,7 +45,7 @@ $ rails motor:install && rake db:migrate
45
45
  * [Configurations sync between environments](#configurations-sync)
46
46
  * [Authentication](#authentication)
47
47
 
48
- ## [Pro](https://www.getmotoradmin.com/rails)
48
+ ## [Pro](https://www.getmotoradmin.com/ruby-on-rails)
49
49
 
50
50
  * Multiple databases support
51
51
  * Audit log
@@ -55,7 +55,7 @@ $ rails motor:install && rake db:migrate
55
55
  * Personalized report alerts via Slack
56
56
  * Full-text search
57
57
  * Shareable forms and reports
58
- * [learn more](https://www.getmotoradmin.com/rails)
58
+ * [learn more](https://www.getmotoradmin.com/ruby-on-rails)
59
59
 
60
60
  ### Customizable CRUD
61
61
 
@@ -238,13 +238,18 @@ module Motor
238
238
  end
239
239
 
240
240
  def build_reference(model, name, reflection)
241
+ primary_key = reflection.polymorphic? ? 'id' : reflection.join_primary_key
242
+ foreign_key = reflection.join_foreign_key
243
+
244
+ primary_key, foreign_key = foreign_key, primary_key if reflection.has_one?
245
+
241
246
  {
242
247
  name: name,
243
248
  display_name: model.human_attribute_name(name),
244
249
  model_name: reflection.polymorphic? ? nil : reflection.klass.name.underscore,
245
250
  reference_type: reflection.belongs_to? ? 'belongs_to' : 'has_one',
246
- foreign_key: reflection.join_foreign_key,
247
- primary_key: reflection.polymorphic? ? 'id' : reflection.join_primary_key,
251
+ foreign_key: foreign_key,
252
+ primary_key: primary_key,
248
253
  options: reflection.options.slice(:through, :source),
249
254
  polymorphic: reflection.polymorphic?,
250
255
  virtual: false
@@ -26,6 +26,10 @@ module Motor
26
26
 
27
27
  key += Motor::DefineArModels.defined_models_schema_md5.to_s if defined?(Motor::DefineArModels)
28
28
 
29
+ if Rails.env.development?
30
+ key += Digest::MD5.hexdigest(ActiveRecord::Base.descendants.map(&:object_id).sort.join)
31
+ end
32
+
29
33
  key
30
34
  end
31
35
 
data/lib/motor/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Motor
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.3'
5
5
  end
@@ -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-66147fbe72d9936a1243.css.gz": "main-66147fbe72d9936a1243.css.gz",
3970
- "main-66147fbe72d9936a1243.js.LICENSE.txt": "main-66147fbe72d9936a1243.js.LICENSE.txt",
3971
- "main-66147fbe72d9936a1243.js.gz": "main-66147fbe72d9936a1243.js.gz",
3972
- "main.css": "main-66147fbe72d9936a1243.css",
3973
- "main.js": "main-66147fbe72d9936a1243.js"
3969
+ "main-53a1a9dffc796b4ca695.css.gz": "main-53a1a9dffc796b4ca695.css.gz",
3970
+ "main-53a1a9dffc796b4ca695.js.LICENSE.txt": "main-53a1a9dffc796b4ca695.js.LICENSE.txt",
3971
+ "main-53a1a9dffc796b4ca695.js.gz": "main-53a1a9dffc796b4ca695.js.gz",
3972
+ "main.css": "main-53a1a9dffc796b4ca695.css",
3973
+ "main.js": "main-53a1a9dffc796b4ca695.js"
3974
3974
  }
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.3.0
4
+ version: 0.3.3
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-07-24 00:00:00.000000000 Z
11
+ date: 2022-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-filter
@@ -2219,8 +2219,8 @@ files:
2219
2219
  - ui/dist/images/marker-icon-2x.png
2220
2220
  - ui/dist/images/marker-icon.png
2221
2221
  - ui/dist/images/marker-shadow.png
2222
- - ui/dist/main-66147fbe72d9936a1243.css.gz
2223
- - ui/dist/main-66147fbe72d9936a1243.js.gz
2222
+ - ui/dist/main-53a1a9dffc796b4ca695.css.gz
2223
+ - ui/dist/main-53a1a9dffc796b4ca695.js.gz
2224
2224
  - ui/dist/manifest.json
2225
2225
  homepage:
2226
2226
  licenses: