tramway-core 1.18.0.2 → 1.18.0.3

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: 938b9d2f7ef998e7ffd0c45cdd9c3b0062a6b65336ae9f8b8c7d587cc984e973
4
- data.tar.gz: ef56b0928a74d9754e2a88376d66e403e2bac10270fdf89c58a1244edb836b61
3
+ metadata.gz: 2d56633f891c4432a43679334bdb0dd8f685709ee8b6afe54f7c4a07f54e1c4f
4
+ data.tar.gz: '09c8f98b97bab7f6a2f07bf2e8da68d0bcae804430771c3534c69a9a88a7a726'
5
5
  SHA512:
6
- metadata.gz: 66b553bb6e941340b3e5929520e36da8e42e8e006493dd29adf73a3cc826ec5c363cfb804646159fab033959d3435ab6f0ef5f3fe2bca9ed2fc0b0871d38e9d8
7
- data.tar.gz: d88d5f0042e1b8ce1ef0e2b8a1b2a3d688492bade95a727a00f2b57f8a4a6ef0d3ea74389601b69416431d4c68d2cafbbc82745d7f85e12486776adf1b83bb7b
6
+ metadata.gz: 370bee32565c5cc51173b003bdea1b4670fe6af1946043077067379171cfbcd42c41ec8c53b6dc30748fed2a2c5dc1d46cf1434ac18d6786680fb8623eca3887
7
+ data.tar.gz: c5a92b7c4448fdc72da951c323302a53c5682a769a1c694623751b12c0693487837c57717a8efd3c020176eba8a47642052d7f75740303ee7dbc6f39c48e0344
data/README.md CHANGED
@@ -157,7 +157,7 @@ copy_to_clipboard "some_id" # some_id is HTML id of element. Content of this ele
157
157
  #### 1. Generate model that you to use. We create Organization, for example
158
158
 
159
159
  ```shell
160
- rails g model organization name:text public_name:text tagline:text address:text phone:text coordinates:point, state: text, favicon:text # remember! State field is required, if you use tramway-admin
160
+ rails g model organization name:text public_name:text tagline:text address:text phone:text coordinates:point state: text favicon:text # remember! State field is required, if you use tramway-admin
161
161
  rails db:migrate
162
162
  ```
163
163
 
@@ -5,19 +5,12 @@ module Tramway::Core::ApplicationForms::PropertiesObjectHelper
5
5
  @form_properties = args
6
6
  end
7
7
 
8
- def form_properties_additional(**args)
9
- @form_properties_additional = args
10
- end
11
-
12
8
  def properties
13
- return @form_properties if @form_properties
14
-
9
+ @form_properties ||= {}
15
10
  yaml_config_file_path = Rails.root.join('app', 'forms', "#{self.class.name.underscore}.yml")
16
11
 
17
- return [] unless File.exist? yaml_config_file_path
12
+ return @form_properties unless File.exist? yaml_config_file_path
18
13
 
19
- @form_properties = YAML.load_file(yaml_config_file_path).deep_symbolize_keys
20
- @form_properties.deep_merge! @form_properties_additional if @form_properties_additional
21
- @form_properties
14
+ @form_properties.deep_merge YAML.load_file(yaml_config_file_path).deep_symbolize_keys
22
15
  end
23
16
  end
@@ -12,7 +12,13 @@ module Tramway::Core::ExtendableFormsHelpers::Submit::ClassHelpers
12
12
  model.values = extended_params.reduce(model.values) do |hash, pair|
13
13
  hash.merge! pair[0] => pair[1]
14
14
  end
15
- super(params) && model.errors.empty?
15
+
16
+ return unless model.errors.empty?
17
+ params.each { |key, value| send("#{key}=", value) }
18
+ result = save
19
+ result.tap do
20
+ collecting_associations_errors unless result
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Core
5
- VERSION = '1.18.0.2'
5
+ VERSION = '1.18.0.3'
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.18.0.2
4
+ version: 1.18.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov