tramway-core 1.13.1 → 1.13.1.1
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: 98fc3b4eb72607b71692a66f9984842cc63cd135f7c498090b5a89ec22d25648
|
4
|
+
data.tar.gz: 955159d6eb34fc36e753a3aba3167846a788a7ce37e9e5d3d657fb542c0d6312
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8901bf8f3c13d43b4bc750dfef901e079bc351eae922674883066ffffaca448c7ba5c3913ef96bf7caed2f52d1872358780295d3dd46c07178f758b6e5ab35b5
|
7
|
+
data.tar.gz: ceb839ae0aa3d97d75a0e7c98c212bd8502ad21f8f411d20871bce24f608fd7818d67284ed271a0ffa22515d8c47b0403422f9aa0aa559b0b66f9e174c0cf2c5
|
@@ -111,8 +111,17 @@ class Tramway::Core::ApplicationDecorator
|
|
111
111
|
|
112
112
|
include Tramway::Core::Concerns::AttributesDecoratorHelper
|
113
113
|
|
114
|
+
RESERVED_WORDS = [ 'fields' ]
|
115
|
+
|
114
116
|
def attributes
|
115
117
|
object.attributes.reduce({}) do |hash, attribute|
|
118
|
+
if attribute[0].in? RESERVED_WORDS
|
119
|
+
error = Tramway::Error.new(
|
120
|
+
plugin: :core,
|
121
|
+
method: :attributes,
|
122
|
+
message: ("Method `#{attribute[0]}` is reserved word. Please, create or delegate method in #{self.class.name} with another name."))
|
123
|
+
raise error.message
|
124
|
+
end
|
116
125
|
value = try(attribute[0]) ? send(attribute[0]) : object.send(attribute[0])
|
117
126
|
if attribute[0].to_s.in? object.class.state_machines.keys.map(&:to_s)
|
118
127
|
hash.merge! attribute[0] => state_machine_view(object, attribute[0])
|
@@ -3,19 +3,19 @@ class Tramway::Core::ExtendedApplicationForm < Tramway::Core::ApplicationForm
|
|
3
3
|
def properties(*args)
|
4
4
|
@@extendable_properties ||= []
|
5
5
|
@@extendable_properties += args
|
6
|
-
super
|
6
|
+
super(*args)
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
10
|
+
def initialize(model)
|
11
|
+
@@extendable_properties.each do |prop|
|
12
|
+
unless model.respond_to? prop
|
13
|
+
model.class.define_method prop do
|
14
|
+
end
|
15
|
+
model.class.define_method "#{prop}=" do |value|
|
17
16
|
end
|
18
17
|
end
|
19
|
-
super
|
20
18
|
end
|
19
|
+
super
|
20
|
+
end
|
21
21
|
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.13.1
|
4
|
+
version: 1.13.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform-rails
|