iron-cms 0.2.0 → 0.2.1
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 +4 -4
- data/app/models/iron/archive.rb +1 -1
- data/app/models/iron/content_import/entry_builder.rb +4 -1
- data/app/models/iron/content_import/field_reconstructor.rb +1 -1
- data/app/models/iron/entry.rb +2 -0
- data/lib/iron/global_id/instance_scoped_locator.rb +2 -0
- data/lib/iron/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc16db2bf8c1ee5f0cca129113aed94f3064d405ae13b7a8a80cc2f601c4a4f
|
4
|
+
data.tar.gz: ff04983432ca9fce51945b29625144685b082047278f6afda51a057e70040b5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f1b195f43f04b198e29f18c8bae4dde22424dd869435db76c1e1ea644f8756e67ca0f0cd6f81b4b83410687c664e14952448b599125630c12a13dc547f744a8
|
7
|
+
data.tar.gz: c3c3fa9ae10cb698dac50abdac3f36fd6d0342f2ca7800e8d42445330fdb7863faab8a562b57d2d432a71e50ba7a12138d90592b77557a455e55a0899bfb5fba
|
data/app/models/iron/archive.rb
CHANGED
@@ -61,7 +61,10 @@ module Iron
|
|
61
61
|
end
|
62
62
|
|
63
63
|
existing_entry = @registry.find_entry(snapshot.gid)
|
64
|
-
|
64
|
+
# Only use the existing entry if it belongs to the correct content type
|
65
|
+
if existing_entry && existing_entry.content_type_id == @content_type.id
|
66
|
+
return existing_entry
|
67
|
+
end
|
65
68
|
|
66
69
|
new_entry = create_entry
|
67
70
|
@registry.register_entry(snapshot.gid, new_entry)
|
@@ -60,7 +60,7 @@ module Iron
|
|
60
60
|
entry = @registry.find_entry(entry_gid)
|
61
61
|
return unless entry
|
62
62
|
|
63
|
-
update_entry_route(entry, snapshot.route)
|
63
|
+
update_entry_route(entry, snapshot.route) unless snapshot.route.nil?
|
64
64
|
reconstruct_entry_fields(entry, snapshot)
|
65
65
|
end
|
66
66
|
|
data/app/models/iron/entry.rb
CHANGED
@@ -4,6 +4,8 @@ module Iron
|
|
4
4
|
|
5
5
|
belongs_to :creator, class_name: "Iron::User", default: -> { Current.user }
|
6
6
|
has_many :fields, inverse_of: :entry, dependent: :destroy
|
7
|
+
has_many :referencing_fields, class_name: "Iron::Field", foreign_key: :referenced_entry_id, dependent: :destroy
|
8
|
+
has_many :referencing_references, class_name: "Iron::Reference", dependent: :destroy
|
7
9
|
|
8
10
|
accepts_nested_attributes_for :fields, allow_destroy: true
|
9
11
|
|
data/lib/iron/version.rb
CHANGED