simpleadmin 1.2.3 → 1.2.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
  SHA1:
3
- metadata.gz: f25cc306014ecb0faf018fdbcbf9a018c0b45151
4
- data.tar.gz: 38095dbfe2da6d22f21672072b7d7cb4d8644be6
3
+ metadata.gz: e99cdb380006f15b9fd1984bcd3ef515dbc7a938
4
+ data.tar.gz: 5648457d8aa33e7e25160290609762c4d26ca2e6
5
5
  SHA512:
6
- metadata.gz: 4dfda0c9329d97f836e1f1606289e7e5634a20db6574f50f4b530fe855a2f0ac95a58633313f6173a64ecb5b5656d2742b0adcec250d02cdd96b3a00f0d74b33
7
- data.tar.gz: 44354b9f194482a097d6d053c2e2051cc2f030575655798a8e6e7f579b36441bb84efaaab34de711ef1e2532e95158316586cd5bd2b2a793833598060e3b215b
6
+ metadata.gz: 1e76548b4c9b3a71daf4dd91101cd4b095356f53406f61730e727eb38c20b981f5faf5299e82ad4644677974910440edba8122186b8709122464a70646dec42e
7
+ data.tar.gz: bca47c1d1a2937231754d1e17996de32202569d1654907a1643dba3bcba9db2bb45fe30e32f64bc248b62e8b670e9e4089411aa5e404fba43158e19c71494317
@@ -18,6 +18,14 @@ module SimpleAdmin
18
18
  render json: resource
19
19
  end
20
20
 
21
+ def show_by
22
+ model_fields = params[:model_fields].map { |model_field| model_field['field_name'] }
23
+
24
+ resource = model_klass.find_by(params[:column_name] => params[:column_value] ).attributes.slice(*model_fields)
25
+
26
+ render json: resource
27
+ end
28
+
21
29
  def create
22
30
  resource = model_klass.new(resource_params)
23
31
 
@@ -19,6 +19,8 @@ module ActionDispatch::Routing
19
19
 
20
20
  resources :resources
21
21
 
22
+ get 'resource_show_by', to: 'resources#show_by'
23
+
22
24
  get 'version', to: 'versions#show'
23
25
  end
24
26
  end
@@ -1,3 +1,3 @@
1
1
  module Simpleadmin
2
- VERSION = '1.2.3'.freeze
2
+ VERSION = '1.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simpleadmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Strukov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-01 00:00:00.000000000 Z
11
+ date: 2019-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler