motor-admin 0.3.1 → 0.3.4

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: 06b1fd64e0fbf089820c31f81a32a51b83322aef9c402001acebc32fd4d5599f
4
- data.tar.gz: 5b30706be8e0a505fadcbab04b591f12a89733ca365e1570753757a6ec68839f
3
+ metadata.gz: b64a0a9d826bc1625ad7e0423176f37781388b71beeba438bf3b964961208c55
4
+ data.tar.gz: 82c10707400ab8c452e728dda5d8cb5219fbc2339b0dd9cb020e2607a2c9045a
5
5
  SHA512:
6
- metadata.gz: add8941a7c206d6331428029fa075a30e1f4ed10fdd35c11047302e5322771f3bf555112b4431002392172ee5ed524b5afe35fcfc88b2cd65cfc79478d9e05a0
7
- data.tar.gz: 4d9a8058d8aa3688f3915554ac01dc40e8c28192f91f09c8db45784e6d5ddebd78d3e623d94e991269c293be66d35e8a209c78202206e86861f14d7b12e884ea
6
+ metadata.gz: e5688351835e69c2c3ccdfb096a0dc2abb16638ce8fe18810517a0a278cef7e7a74bf406e48bf8ce2be47cd6b9b65b5455ac4ab2c0ef868683fc5cbedced125c
7
+ data.tar.gz: 2f3f1f8e709d4f10767ade44a5495ef136d57a18a1cc70e4b4f0e92a0afb6629ef7ed8cdb884147f2037e6a7eb97e0bb792f4063bb5bf9664b150ba2702aa4bd
data/README.md CHANGED
@@ -1,8 +1,8 @@
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
 
@@ -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
@@ -195,7 +195,7 @@ module Motor
195
195
  sql.gsub(STATEMENT_VARIABLE_REGEXP, '?'),
196
196
  attributes.map(&:value))
197
197
 
198
- [sql, 'SQL', attributes]
198
+ [sql, 'SQL', []]
199
199
  end
200
200
 
201
201
  def normalize_sql(sql)
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.1'
4
+ VERSION = '0.3.4'
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.1
4
+ version: 0.3.4
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-08-03 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: