simpleadmin 1.1.0 → 1.2.0

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: d24bb4088260152dd39c1f8646f3c340c3966022
4
- data.tar.gz: 4e0bb41b01affa610f0c4c118a0c26dcf5df6328
3
+ metadata.gz: af0221e12ddb14b516c3a1dffc1e9e7eddd1e85d
4
+ data.tar.gz: 4226499832002e5a97601deb56bb3a2fd9abb948
5
5
  SHA512:
6
- metadata.gz: 26491122a5263e40004d2905735fdce4746a018f5411461e515da0adcadb7f08868f1bbb0ebfaa312507eb8a2bdba92ece5c7d6629a11a450405015256b0ac47
7
- data.tar.gz: 78b7143d2132d9f00f7d1d8982c4ff4b9aa118d6bc8bb952149586d008532298c371926b6f2d8dd6384025b774fc1542c516131b61343c917c5b485ecc95141a
6
+ metadata.gz: c02cc73fbfc2879ca99efe47fdaa005b16637f697d396183c8f1c2f4dc6c9d3b96be00a6ad299554310959771cb9b66430484e076dd9c07ad48cb5f78b2914f6
7
+ data.tar.gz: f2700a37d4c9b8a3142c8d41776a73b04b0ec89c367d0c1f5a5fc4f4bdc84d664b31a960a87d868d9b8b5d017f42586cc65ac19d9f5334cb57323d4454f21ac4
@@ -0,0 +1,9 @@
1
+ module SimpleAdmin
2
+ class EntityFieldTypeActionsController < BaseController
3
+ def create
4
+ field_type = params[:entity_field_type_name].constantize
5
+
6
+ render json: field_type.new.run(params[:field_name], params[:model_klass_name])
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ module EntityFieldTypes
2
+ class StatusField
3
+ def run(field_name, model_klass_name)
4
+ resource_klass = model_klass_name.constantize
5
+ resource_klass.public_send(field_name.pluralize).keys
6
+ end
7
+ end
8
+ end
@@ -15,6 +15,8 @@ module ActionDispatch::Routing
15
15
  def mount_simpleadmin
16
16
  namespace :simple_admin do
17
17
  resources :entities, only: [:index, :show]
18
+ resources :entity_field_type_actions, only: :create
19
+
18
20
  resources :resources
19
21
 
20
22
  get 'version', to: 'versions#show'
@@ -1,3 +1,3 @@
1
1
  module Simpleadmin
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
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.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Strukov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-10 00:00:00.000000000 Z
11
+ date: 2018-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -110,8 +110,10 @@ files:
110
110
  - Rakefile
111
111
  - app/controllers/simple_admin/base_controller.rb
112
112
  - app/controllers/simple_admin/entities_controller.rb
113
+ - app/controllers/simple_admin/entity_field_type_actions_controller.rb
113
114
  - app/controllers/simple_admin/resources_controller.rb
114
115
  - app/controllers/simple_admin/versions_controller.rb
116
+ - app/services/entity_field_types/status_field.rb
115
117
  - bin/console
116
118
  - bin/setup
117
119
  - lib/simpleadmin.rb