tramway-core 1.13.0.1 → 1.13.0.2
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: 49a4349d7dbfe36f3536a92ccd18d76d6f0cdf86c513637961ff97d1e06df29a
|
4
|
+
data.tar.gz: 8be9e068cb027c8b3c56fb8b10fffc14b47e8caec5f285ff41a1b27daaedb952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 994bd99028e45e64b24a36fc01c901cb0a7dfac84cf906487446be4d94fe214bf349b83caabf2c7c1585e866d76e5f8c7f7f757daf8c8543a48dc4cbd61ba25b
|
7
|
+
data.tar.gz: 8530fb7a9f75b5dfbda7b8312cd9a4f1e7d4b8304eb0123e999a615f33eb7f8758d058781f55ae505104f7ee297d38f6c72f82c3217e28ae8be5b658a66ff56d
|
@@ -11,7 +11,11 @@ module Tramway::Core
|
|
11
11
|
if class_name.is_a? Array
|
12
12
|
self.class.send(:define_method, "#{association}=") do |value|
|
13
13
|
association_class = send("#{association}_type")
|
14
|
-
|
14
|
+
if association_class.nil?
|
15
|
+
raise Tramway::Error.new(plugin: :core, method: :initialize, message: 'Polymorphic association class is nil. Maybe, you should write `assocation #{association_name}` after `properties #{association_name}_id, #{association_name}_type`')
|
16
|
+
else
|
17
|
+
super association_class.constantize.find value
|
18
|
+
end
|
15
19
|
end
|
16
20
|
else
|
17
21
|
self.class.send(:define_method, "#{association}=") do |value|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
= f.input field.title.to_sym, as: field.field_type, input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }
|
8
8
|
- when 'select'
|
9
9
|
- parsed_json = field.options.is_a?(Hash) ? field.options : (JSON.parse(field.options) unless field.options == '')
|
10
|
-
- if parsed_json
|
10
|
+
- if parsed_json&.dig('collection', 'name')
|
11
11
|
- if value.present?
|
12
12
|
= f.input field.title.to_sym, as: :select, collection: collection_list_by(name: parsed_json['collection']['name']), input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }, selected: value
|
13
13
|
- else
|
@@ -1,11 +1,9 @@
|
|
1
|
-
|
1
|
+
en:
|
2
2
|
activerecord:
|
3
3
|
attributes:
|
4
4
|
tramway/core/application_record:
|
5
5
|
created_at: Created at
|
6
6
|
updated_at: Updated at
|
7
7
|
state: State
|
8
|
-
|
9
|
-
|
10
|
-
plural: пользователи
|
11
|
-
genitive: пользователя
|
8
|
+
errors:
|
9
|
+
wrong_email_or_password: Wrong email or password
|
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.0.
|
4
|
+
version: 1.13.0.2
|
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-09-
|
11
|
+
date: 2019-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reform-rails
|