tramway-core 1.18.0.2 → 1.18.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d56633f891c4432a43679334bdb0dd8f685709ee8b6afe54f7c4a07f54e1c4f
|
4
|
+
data.tar.gz: '09c8f98b97bab7f6a2f07bf2e8da68d0bcae804430771c3534c69a9a88a7a726'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
14
|
-
|
9
|
+
@form_properties ||= {}
|
15
10
|
yaml_config_file_path = Rails.root.join('app', 'forms', "#{self.class.name.underscore}.yml")
|
16
11
|
|
17
|
-
return
|
12
|
+
return @form_properties unless File.exist? yaml_config_file_path
|
18
13
|
|
19
|
-
@form_properties
|
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
|
-
|
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
|
data/lib/tramway/core/version.rb
CHANGED