rails_admin_json_translate 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_admin_json_translate.rb +9 -1
- data/lib/rails_admin_json_translate/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d63c2457f0afb48811e0c1ce2fd9a0d675f3e4
|
4
|
+
data.tar.gz: 1c22fcf300fa8e1068f9b5813d130c6670cffdf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63df774a37a3bba4b690c9f9905696c1f2eb6af848698b3582c39c13a5f2057ec01f305e4543d13458e8ae142feca7cc6bcb092501269397ab08f49ef0dcab41
|
7
|
+
data.tar.gz: '0469a8f368c16a3137eab9bd31458e1c16af3b4876f625d24f4c951802e0f308dd3949792d30c5994c7a824b5f61b6d94dc4af8ad834ab6c5aeb92ca1f8cd1dc'
|
@@ -9,7 +9,7 @@ module RailsAdmin
|
|
9
9
|
module Config
|
10
10
|
module Fields
|
11
11
|
module Types
|
12
|
-
class JsonTranslate < RailsAdmin::Config::Fields::
|
12
|
+
class JsonTranslate < RailsAdmin::Config::Fields::Types::Text
|
13
13
|
RailsAdmin::Config::Fields::Types.register(:json_translate, self)
|
14
14
|
|
15
15
|
register_instance_option :partial do
|
@@ -24,6 +24,14 @@ module RailsAdmin
|
|
24
24
|
I18n.available_locales
|
25
25
|
end
|
26
26
|
|
27
|
+
def parse_value(value)
|
28
|
+
value.present? ? JSON.parse(value) : nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def parse_input(params)
|
32
|
+
params[name] = parse_value(params[name]) if params[name].is_a?(::String)
|
33
|
+
end
|
34
|
+
|
27
35
|
def value_for_locale(locale)
|
28
36
|
val = @bindings[:object].send(name)
|
29
37
|
return '' unless val
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_json_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Venneman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.5.
|
191
|
+
rubygems_version: 2.5.2
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: Integrate json_translate into rails_admin
|