tramway-core 1.13.0.1 → 1.13.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf7bf29b470ad31875476f19e0e0f83677783537fd35dae8835b35e7f536d8cb
4
- data.tar.gz: c99b1862ccd1f615f9234b48a0e2a6d0a1ffda66ed7edfc42b3e36d32521594c
3
+ metadata.gz: 49a4349d7dbfe36f3536a92ccd18d76d6f0cdf86c513637961ff97d1e06df29a
4
+ data.tar.gz: 8be9e068cb027c8b3c56fb8b10fffc14b47e8caec5f285ff41a1b27daaedb952
5
5
  SHA512:
6
- metadata.gz: 3dbdee11985f307be85407396f14b3cbcfb4808e5c060f042a269bd61d2517bb9da667f71f844874939e090ec28e5ae418e70f25d37b9bb82356e23c3abafa3e
7
- data.tar.gz: 21d3c8d69ab73cf806de1c288b658a29f3a0222751c0190190832fdbec80ae04e181f5dbe5cf32d3a5c196e578a511e43a66e6b0b5ddd758472401a65dc2470d
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
- super association_class.constantize.find value
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 && parsed_json.dig('collection', 'name')
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
- ru:
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
- cases:
9
- tramway/user/user:
10
- plural: пользователи
11
- genitive: пользователя
8
+ errors:
9
+ wrong_email_or_password: Wrong email or password
@@ -17,3 +17,8 @@ ru:
17
17
  found: Найденные
18
18
  "yes": Да
19
19
  "no": Нет
20
+ tramway:
21
+ admin:
22
+ welcome:
23
+ index:
24
+ title: Админка
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.13.0.1'
3
+ VERSION = '1.13.0.2'
4
4
  end
5
5
  end
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2019-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails