tramway-core 1.14.1.1 → 1.14.1.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: 8dd03e903c3da051f37a4eefbb5e54a5efe47484cc37d3362ff1162edd25f440
4
- data.tar.gz: 6d0f3fac662adafee2f7065918cc56fdf1a68c7c6e133f1f254ba5b0790c355e
3
+ metadata.gz: 8e37bc7fd023ce8768a173d48b50575ac71538cb27078c8cabf2d4aaf996c53c
4
+ data.tar.gz: 253c5c1543f25b34905341bdc11d9a31e84737cf11a2c1e547c5f0c3d9d16cb6
5
5
  SHA512:
6
- metadata.gz: c101e099080222ec11205155027a70493232181ee3c528bcf8fd13937e1c6e2eb318768d911ec8e9d5215c8c8eceb52946743c18f2ed0fd68676de18f3a19ba8
7
- data.tar.gz: 220af3ce5f627bc11578324e5d17245140f77ffcd59c676c76ff24d804f57cd6ffdd0f79b7fdd8fe882f7ef2381c715b81939a91513a4efbe89d712a763b32c2
6
+ metadata.gz: 2bb111d0932442985c8a93edd2e3c0acfdeef417565d032560f895584e8efb783c9f3a1323688f8680a29a0cf95485c658e2029b4b0e78f10c7f536374484f20
7
+ data.tar.gz: fd7a7cdcc2b47374e1c1405b1278219ba4e7e17fc0209bf22895339d24c619d2156a5af641c16b5423ad0ed0ae1ea95f738d1c669938e1015d251d5205aaca27
@@ -32,7 +32,18 @@ module Tramway::Core
32
32
 
33
33
  def submit(params)
34
34
  if params
35
- save if validate params
35
+ if validate params
36
+ save
37
+ else
38
+ association_error = false
39
+ @@associations.each do |association|
40
+ if errors.details[association] == [{ error: :blank }]
41
+ model.send("#{association}=", send(association))
42
+ association_error = true
43
+ end
44
+ end
45
+ association_error && save
46
+ end
36
47
  else
37
48
  error = Tramway::Error.new(plugin: :core, method: :submit, message: 'ApplicationForm::Params should not be nil')
38
49
  raise error.message
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '1.14.1.1'
5
+ VERSION = '1.14.1.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1.1
4
+ version: 1.14.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov