avo 4.0.0.beta.26 → 4.0.0.beta.27
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: ffaccc2c7b502dd73f16b6b1d28a75465fe521b5412b8eab656cbdc0a802b02b
|
|
4
|
+
data.tar.gz: 7b4258f1a337ee54439ec3055e9e27be9b9dc0e107cbcacc2104c63898b012f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3767040fef507a81119f6e9c2b5188b80b2b7c6c6154fe10f5b79dfe541ca50e937d9a0889eb1648da970d3ce65acc82a6da9349dfe17e7cf612490a1e220cee
|
|
7
|
+
data.tar.gz: 79d47d991f91c929327aac445bfdf3d78ea0aa6457ac71f00b96d54dc7599f94892ba63362f0747e7c006a33be9cb06489079d59a7a96503275356bcae17b2af
|
data/Gemfile.lock
CHANGED
|
@@ -62,6 +62,7 @@ class Avo::Fields::BelongsToField::EditComponent < Avo::Fields::EditComponent
|
|
|
62
62
|
|
|
63
63
|
helpers.new_resource_path(**{
|
|
64
64
|
via_relation: @field.id.to_s,
|
|
65
|
+
via_relation_class: resource.model_class.to_s,
|
|
65
66
|
resource: target_resource || @field.target_resource,
|
|
66
67
|
via_record_id: resource.record.persisted? ? resource.record.to_param : nil,
|
|
67
68
|
via_belongs_to_resource_class: resource.class.name,
|
|
@@ -31,9 +31,7 @@
|
|
|
31
31
|
<% end %>
|
|
32
32
|
<% end %>
|
|
33
33
|
|
|
34
|
-
<div class="flex-1 flex p-4">
|
|
35
|
-
<%= @action.get_message %>
|
|
36
|
-
</div>
|
|
34
|
+
<div class="flex-1 flex p-4 whitespace-pre-line"><%= @action.get_message %></div>
|
|
37
35
|
<%= form.hidden_field :avo_resource_ids, value: params[:id] || params[:resource_ids], 'data-action-target': 'resourceIds' %>
|
|
38
36
|
<%= form.hidden_field :avo_selected_all, 'data-action-target': 'selectedAll' %>
|
|
39
37
|
<%= form.hidden_field :avo_index_query, 'data-action-target': 'indexQuery' %>
|
data/lib/avo/resources/base.rb
CHANGED
|
@@ -622,16 +622,16 @@ module Avo
|
|
|
622
622
|
|
|
623
623
|
reflection = @record.class.reflect_on_association(@params[:via_relation]) if @params[:via_relation].present?
|
|
624
624
|
|
|
625
|
-
if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params[:via_relation_class])
|
|
625
|
+
if field.polymorphic_as.present? && field.types.map(&:to_s).include?(@params[:via_relation_class]) && @params[:via_record_id].present?
|
|
626
626
|
# set the value to the actual record
|
|
627
627
|
via_resource = Avo.resource_manager.get_resource_by_model_class(@params[:via_relation_class])
|
|
628
|
-
value = via_resource.find_record(@params[:via_record_id])
|
|
629
|
-
elsif reflection.present? && reflection.foreign_key.present? && field.id.to_s == @params[:via_relation].to_s
|
|
628
|
+
value = via_resource.find_record(@params[:via_record_id]) if via_resource.present?
|
|
629
|
+
elsif reflection.present? && reflection.foreign_key.present? && field.id.to_s == @params[:via_relation].to_s && @params[:via_record_id].present?
|
|
630
630
|
resource = Avo.resource_manager.get_resource_by_model_class params[:via_relation_class]
|
|
631
|
-
record = resource.find_record @params[:via_record_id], params: params
|
|
631
|
+
record = resource.find_record @params[:via_record_id], params: params if resource.present?
|
|
632
632
|
id_param = reflection.options[:primary_key] || :id
|
|
633
633
|
|
|
634
|
-
value = record.send(id_param)
|
|
634
|
+
value = record.send(id_param) if record.present?
|
|
635
635
|
end
|
|
636
636
|
end
|
|
637
637
|
|
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.0.beta.
|
|
4
|
+
version: 4.0.0.beta.27
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adrian Marin
|
|
8
8
|
- Mihai Marin
|
|
9
9
|
- Paul Bob
|
|
10
|
-
autorequire:
|
|
11
10
|
bindir: bin
|
|
12
11
|
cert_chain: []
|
|
13
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: activerecord
|
|
@@ -1162,8 +1161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1162
1161
|
- !ruby/object:Gem::Version
|
|
1163
1162
|
version: '0'
|
|
1164
1163
|
requirements: []
|
|
1165
|
-
rubygems_version:
|
|
1166
|
-
signing_key:
|
|
1164
|
+
rubygems_version: 4.0.9
|
|
1167
1165
|
specification_version: 4
|
|
1168
1166
|
summary: Admin panel framework and Content Management System for Ruby on Rails.
|
|
1169
1167
|
test_files: []
|