tramway-core 1.3.1 → 1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b436d58271dd2c84429b1bfc299397a66c7bfa7230da9102c2c033e962e61437
|
4
|
+
data.tar.gz: 8413118e4e1570430d93aec83539cff8049d215dba9a0a9e100e98942fc99743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0caabf94570876be4cf2ac7dbdb297e7849163f0ec0c50711004dba6bb5ce5115311fcfa01740ceed3d7eeacf5b363ad7f8bdc63aa5671a092620aa5ff5e505e
|
7
|
+
data.tar.gz: 410070b6ba92ae42852a716e56352aefc5e19aac105933de7bf5902045a720227b4f68dedbbdee54c7092470a3b5ebc36e127077563cd5d5576ec68aed8b9bd9
|
@@ -42,7 +42,7 @@ class Tramway::Core::ApplicationDecorator
|
|
42
42
|
|
43
43
|
def attributes
|
44
44
|
object.attributes.reduce({}) do |hash, attribute|
|
45
|
-
value = object.send
|
45
|
+
value = try(attribute[0]) ? send(attribute[0]) : object.send(attribute[0])
|
46
46
|
if attribute[0].to_s.in? object.class.state_machines.keys.map(&:to_s)
|
47
47
|
hash.merge! attribute[0] => object.send("human_#{attribute[0]}_name")
|
48
48
|
elsif value.class.in? [ ActiveSupport::TimeWithZone, DateTime, Time ]
|
@@ -58,7 +58,7 @@ class Tramway::Core::ApplicationDecorator
|
|
58
58
|
elsif value.is_a? Enumerize::Value
|
59
59
|
hash.merge! attribute[0] => value.text
|
60
60
|
else
|
61
|
-
hash.merge! attribute[0] =>
|
61
|
+
hash.merge! attribute[0] => value
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
@@ -7,8 +7,8 @@ class Tramway::Core::ExtendableForm
|
|
7
7
|
Object.const_set(name, Class.new(::Tramway::Core::ApplicationForm) do
|
8
8
|
define_method 'submit' do |params|
|
9
9
|
model.values ||= {}
|
10
|
-
model.values = params.permit!.to_h.reduce({}) do |hash,
|
11
|
-
hash.merge!
|
10
|
+
model.values = params.permit!.to_h.reduce({}) do |hash, pair|
|
11
|
+
hash.merge! pair[0] => pair[1]
|
12
12
|
end
|
13
13
|
super params
|
14
14
|
end
|
data/lib/tramway/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform-rails
|