administrate-field-jsonb 0.3.0 → 0.4.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: 5eb4e29421277cef5cd5f24b45aacd7ea4b3af22
4
- data.tar.gz: 7defd9d8f0a0a0fad1568a05343104e9128574d7
3
+ metadata.gz: f063b7cfbb398bbce63a6be7cb36600c9eb1855b
4
+ data.tar.gz: 4d6546c1ad1d4fa2b044143af2718b401543d3d2
5
5
  SHA512:
6
- metadata.gz: d4ebb23aaa1923b04e24649566ff77c3430eaa6d48e43dd403db0f006f36c5f1b431479af7be2dcaf99ec9b6296364570b77c45c6513eb8f80d67c126053e9cd
7
- data.tar.gz: 73e0b6efceb262ba60df6c7150ce24760577c9ce5e5016f66afc87d972209b68cd8cee0a286245607b223bdefbaf3aa4845f8bfcc49b54655ed9eb139b355655
6
+ metadata.gz: 82b867137242cdcc301d81e95b23f7341db12ed53aaf1340e7547fd8f87dbc05523726fee627c4bf5c677a6636dc56d951e9f7ef7a45b606a2589aad35ea1bab
7
+ data.tar.gz: 91b0ed65ecc649447841b0727fb021d811dc9c44d8c4b5e70c0e24c96f561d201e80a1d8fee8a5b447e5db2977f9b766b2ed2873b2107317ed35f3de942f4b9c
@@ -2,7 +2,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__)
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = 'administrate-field-jsonb'
5
- gem.version = '0.3.0'
5
+ gem.version = '0.4.0'
6
6
  gem.authors = ['Sergey Volkov', 'Codica']
7
7
  gem.email = ['sergvolkov.codica@gmail.com']
8
8
  gem.homepage = 'https://github.com/codica2/administrate-field-jsonb'
@@ -1,4 +1,6 @@
1
- <% if field.advanced_view? %>
1
+ <% if field.transform.blank? %>
2
+ <%= render field.to_partial_path('field'), type: ::Administrate::Field::String, key: field.attribute, value: '' %>
3
+ <% elsif field.advanced_view? %>
2
4
  <dl class='administrate-field-jsonb-wrapper'>
3
5
  <% if field.array? %>
4
6
  <%= render field.to_partial_path('array'), field: field, structure: field.advanced_view, data: field.transform %>
@@ -9,6 +9,7 @@ module Administrate
9
9
  class JSONB < Administrate::Field::Base
10
10
 
11
11
  def transform
12
+ return nil if data.blank?
12
13
  return data unless options[:transform].present? && options[:transform].is_a?(Array)
13
14
 
14
15
  result = data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-jsonb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Volkov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-04 00:00:00.000000000 Z
12
+ date: 2019-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: administrate